dsfml.graphics.renderwindow



class RenderWindow: dsfml.window.window.Window;
Simple wrapper for Window that allows easy 2D rendering.

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

Params:
VideoMode mode Video mode to use
char[] title Title of the window
ulong 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, ulong windowStyle = cast(ulong)(cast(Style)2 | cast(Style)4), WindowSettings settings = opCall(24u,8u,0u));
Create (or recreate) the window

Input created with getInput will become invalid.

Params:
VideoMode mode Video mode to use
char[] title Title of the window
ulong 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 become invalid.

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

void draw(PostFX postFX);
Draw a PostFX on the window

Params:
PostFX postFX Object to draw

void draw(IDrawable obj);
Draw a Sprite or a String

Params:
IDrawable obj IDrawable object to draw

Image capture();
Save the content of the window to an image

Returns:
Image instance containing the contents of the screen

void setBackgroundColor(Color col);
Change the background color of the window. The default color is black

Params:
Color col New background color

void setView(View newView);
Change the current active view. The current view is defined with the initial size of the window

Params:
View newView Pointer to the new view (pass getDefaultView to set the default view)

View getView();
Get the current view rectangle

Returns:
current view rectangle, in global coordinates

View getDefaultView();
Get the default view

Returns:
default view

Vector2!(float) convertCoords(uint windowX, uint windowY, View targetView = cast(View)null);
Convert a point in window coordinates into view coordinates

Params:
uint windowX X coordinate of the point to convert, relative to the window
uint windowY Y coordinate of the point to convert, relative to the window
View targetView Target view to convert the point to (pass NULL to use the current view)

Returns:
Converted point

void preserveOpenGLStates(bool preserve);
Tell SFML to preserve external OpenGL states, at the expense of more CPU charge. Use this function if you don't want SFML to mess up your own OpenGL states (if any). Don't enable state preservation if not needed, as it will allow SFML to do internal optimizations and improve performances. This parameter is false by default

Params:
bool preserve True to preserve OpenGL states, false to let SFML optimize


Page generated by Ddoc.