CreateWindow ( zstr x y w h fl -- win )
published: 26 October 2024 / updated 8 November 2024
vocabulary: SDL2
Create a window with the specified position, dimensions, and flags.
Parameters:
- title the title of the window, in UTF-8 encoding
- x the x position of the window, SDL_WINDOWPOS_CENTERED, or SDL_WINDOWPOS_UNDEFINED
- y the y position of the window, SDL_WINDOWPOS_CENTERED, or SDL_WINDOWPOS_UNDEFINED
- w the width of the window, in screen coordinates
- h the height of the window, in screen coordinates
- flags 0, or one or more SDL_WindowFlags OR'd together
Returns win that was created or 0 on failure.
Example:
\ define size and position for SDL window
800 constant SCREEN_WIDTH
400 constant SCREEN_HEIGHT
200 constant X0_SCREEN_POSITION
50 constant Y0_SCREEN_POSITION
z" My first window with SDL2"
X0_SCREEN_POSITION Y0_SCREEN_POSITION
SCREEN_WIDTH SCREEN_HEIGHT
SDL_WINDOW_SHOWN CreateWindow
value WIN0
Legal: site web personnel sans commerce / personal site without seling
