dsfml.window.window



class Window;
Window is a rendering window ; it can create a new window or connect to an existing one

this(VideoMode mode, char[] title, Style windowStyle = cast(Style)2 | cast(Style)4, WindowSettings settings = (WindowSettings)(24u,8u,0u));
Construct a new window

Params:
VideoMode mode Video mode to use
char[] title Title of the window
Style windowStyle Window style (Resize | Close by default)
WindowSettings settings Window settings (default is default WindowSettings values)

this(WindowHandle handle, WindowSettings settings = (WindowSettings)(24u,8u,0u));
Construct the window from an existing control

Params:
WindowHandle handle Platform-specific handle of the control
WindowSettings settings Window settings (default is default WindowSettings values)

void create(VideoMode mode, char[] title, Style windowStyle = cast(Style)2 | cast(Style)4, WindowSettings settings = opCall(24u,8u,0u));
Create (or recreate) the window

Input created with getInput becomes invalid.

Params:
VideoMode mode Video mode to use
char[] title Title of the window
Style windowStyle Window style (Resize | Close by default)
WindowSettings settings Window settings (default is default WindowSettings values)

void create(WindowHandle handle, WindowSettings settings = opCall(24u,8u,0u));
Create (or recreate) the window from an existing control

Input created with getInput becomes invalid.

Params:
WindowHandle handle Platform-specific handle of the control
WindowSettings settings Window settings (default is default WindowSettings values)

void close();
Close (destroy) the window. You can call create to recreate a valid window

bool isOpened();
Tell whether or not a window is opened

Returns:
True if window is currently open.

uint getWidth();
Get the width of the rendering region of the window

Returns:
Width in pixels

uint getHeight();
Get the height of the rendering region of the window

Returns:
Height in pixels

WindowSettings getSettings();
Get the creation settings of a window

Returns:
Settings used to create the window

bool getEvent(ref Event eventReceived);
Get the event on top of events stack, if any, and pop it

Params:
Event eventReceived Event to fill, if any

Returns:
True if an event was returned, false if events stack was empty

void useVerticalSync(bool enabled);
Enable / disable vertical synchronization

Params:

void showMouseCursor(bool show);
Show or hide the mouse cursor

Params:

void setCursorPosition(uint left, uint top);
Change the position of the mouse cursor

Params:
uint left Left coordinate of the cursor, relative to the window
uint top Top coordinate of the cursor, relative to the window

void setPosition(int left, int top);
Change the position of the window on screen. Only works for top-level windows

Params:
int left Left position
int top Top position

void show(bool state);
Show or hide the window

Params:
bool state True to show, false to hide

void enableKeyRepeat(bool enabled);
Enable or disable automatic key-repeat for keydown events. Automatic key-repeat is enabled by default.

Params:
bool enabled true to enable, false to disable

bool setActive(bool active);
Set the window as the current target for rendering

Params:
bool active True to activate, false to deactivate

Returns:
True if operation was successful, false otherwise

void display();
Display the window on screen

Input getInput();
Get the input manager of the window

Returns:
An input manager See_Also : Input

void setFramerateLimit(uint limit);
Limit the framerate to a maximum fixed frequency

Params:

float getFrameTime();
Get time elapsed since last frame

Returns:
Time elapsed, in seconds

void setJoystickThreshold(float threshold);
Change the joystick threshold, ie. the value below which no move event will be generated

Params:


Page generated by Ddoc.