RenderWindow

Window that can serve as a target for 2D drawing.

class RenderWindow : Window , RenderTarget {}

Constructors

this
this()

Default constructor.

this
this(VideoMode mode, const(T)[] title, Style style, ContextSettings settings)

Construct a new window.

this
this(VideoMode mode, const(dchar)[] title, Style style, ContextSettings settings)

Construct a new window.

this
this(WindowHandle handle, ContextSettings settings)

Construct the window from an existing control.

Destructor

~this
~this()
Undocumented in source.

Members

Functions

capture
Image capture()

Copy the current contents of the window to an image

clear
void clear(Color color)

Clear the entire target with a single color.

close
void close()

Close the window and destroy all the attached resources.

create
void create(VideoMode mode, const(char)[] title, Style style, ContextSettings settings)
void create(VideoMode mode, const(wchar)[] title, Style style, ContextSettings settings)

Create (or recreate) the window.

create
void create(VideoMode mode, const(dchar)[] title, Style style, ContextSettings settings)

Create (or recreate) the window.

create
void create(WindowHandle handle, ContextSettings settings)

Create (or recreate) the window from an existing control.

display
void display()

Display on screen what has been rendered to the window so far.

draw
void draw(Drawable drawable, RenderStates states)

Draw a drawable object to the render target.

draw
void draw(const(Vertex)[] vertices, PrimitiveType type, RenderStates states)

Draw primitives defined by an array of vertices.

getDefaultView
View getDefaultView()

Get the default view of the render target.

getMousePosition
Vector2i getMousePosition()
Undocumented in source. Be warned that the author may not have intended to support it.
getSettings
ContextSettings getSettings()

Get the settings of the OpenGL context of the window.

getSize
Vector2u getSize()

Return the size of the rendering region of the target.

getSystemHandle
WindowHandle getSystemHandle()

Get the OS-specific handle of the window.

isOpen
bool isOpen()

Tell whether or not the window is open.

pollEvent
bool pollEvent(Event event)

Pop the event on top of the event queue, if any, and return it.

popGLStates
void popGLStates()

Restore the previously saved OpenGL render states and matrices.

pushGLStates
void pushGLStates()

Save the current OpenGL render states and matrices.

resetGLStates
void resetGLStates()

Reset the internal OpenGL states so that the target is ready for drawing.

setActive
bool setActive(bool active)

Get the viewport of a view, applied to this render target.

setFramerateLimit
void setFramerateLimit(uint limit)

Limit the framerate to a maximum fixed frequency.

setIcon
void setIcon(uint width, uint height, const(ubyte[]) pixels)

Change the window's icon.

setJoystickThreshhold
void setJoystickThreshhold(float threshhold)

* Change the joystick threshold. * * The joystick threshold is the value below which no JoystickMoved event * will be generated. * * The threshold value is 0.1 by default. * * Params: * threshhold = New threshold, in the range [0, 100]

setJoystickThreshold
void setJoystickThreshold(float threshold)

Change the joystick threshold.

setKeyRepeatEnabled
void setKeyRepeatEnabled(bool enabled)

Enable or disable automatic key-repeat.

setMouseCursorVisible
void setMouseCursorVisible(bool visible)

Show or hide the mouse cursor.

setMousePosition
void setMousePosition(Vector2i pos)
Undocumented in source. Be warned that the author may not have intended to support it.
setTitle
void setTitle(const(char)[] newTitle)

Change the title of the window

setTitle
void setTitle(const(wchar)[] newTitle)

Change the title of the window

setTitle
void setTitle(const(dchar)[] newTitle)

Change the title of the window

setVerticalSyncEnabled
void setVerticalSyncEnabled(bool enabled)

Enable or disable vertical synchronization.

setVisible
void setVisible(bool visible)

Show or hide the window.

waitEvent
bool waitEvent(Event event)

Wait for an event and return it.

Properties

position
Vector2i position [@property setter]
Vector2i position [@property getter]

Change the position of the window on screen.

size
Vector2u size [@property setter]
Vector2u size [@property getter]

The size of the rendering region of the window.

view
View view [@property setter]
View view [@property getter]

Change the current active view.

Static functions

windowPointer
void* windowPointer(const(Window) window)
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

sfPtr
sfRenderWindow* sfPtr;
Undocumented in source.

Inherited Members

From Window

Style
enum Style

Choices for window style

sfPtr
sfWindow* sfPtr;
Undocumented in source.
deleteWindowPtr
void deleteWindowPtr()
Undocumented in source. Be warned that the author may not have intended to support it.
~this
~this()

Destructor.

position
Vector2i position [@property setter]
Vector2i position [@property getter]

Get's or set's the window's position.

size
Vector2u size [@property setter]

Get's or set's the window's size.

size
Vector2u size [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
setActive
bool setActive(bool active)

Activate or deactivate the window as the current target for OpenGL rendering.

requestFocus
void requestFocus()

Request the current window to be made the active foreground window.

hasFocus
bool hasFocus()

Check whether the window has the input focus

setFramerateLimit
void setFramerateLimit(uint limit)

Limit the framerate to a maximum fixed frequency.

setIcon
void setIcon(uint width, uint height, const(ubyte[]) pixels)

Change the window's icon.

setJoystickThreshold
void setJoystickThreshold(float threshold)

Change the joystick threshold.

setJoystickThreshhold
void setJoystickThreshhold(float threshhold)

Change the joystick threshold.

setKeyRepeatEnabled
void setKeyRepeatEnabled(bool enabled)

Enable or disable automatic key-repeat.

setMouseCursorVisible
void setMouseCursorVisible(bool visible)

Show or hide the mouse cursor.

setTitle
void setTitle(const(char)[] newTitle)
void setTitle(const(wchar)[] newTitle)

Change the title of the window.

setTitle
void setTitle(const(dchar)[] newTitle)

Change the title of the window.

setVisible
void setVisible(bool visible)

Show or hide the window.

setVerticalSyncEnabled
void setVerticalSyncEnabled(bool enabled)

Enable or disable vertical synchronization.

getSettings
ContextSettings getSettings()

Get the settings of the OpenGL context of the window.

getSystemHandle
WindowHandle getSystemHandle()

Get the OS-specific handle of the window.

close
void close()

Close the window and destroy all the attached resources.

create
void create(VideoMode mode, const(char)[] title, Style style, ContextSettings settings)
void create(VideoMode mode, const(wchar)[] title, Style style, ContextSettings settings)

Create (or recreate) the window.

create
void create(VideoMode mode, const(dchar)[] title, Style style, ContextSettings settings)
void create(WindowHandle handle, ContextSettings settings)

Create (or recreate) the window.

display
void display()

Display on screen what has been rendered to the window so far.

isOpen
bool isOpen()

Tell whether or not the window is open.

pollEvent
bool pollEvent(Event event)

Pop the event on top of the event queue, if any, and return it.

waitEvent
bool waitEvent(Event event)

Wait for an event and return it.

getMousePosition
Vector2i getMousePosition()
Undocumented in source. Be warned that the author may not have intended to support it.
mouse_getPosition
Vector2i mouse_getPosition()
Undocumented in source. Be warned that the author may not have intended to support it.
setMousePosition
void setMousePosition(Vector2i pos)
Undocumented in source. Be warned that the author may not have intended to support it.
mouse_SetPosition
void mouse_SetPosition(Vector2i pos)
Undocumented in source. Be warned that the author may not have intended to support it.
getWindowPointer
void* getWindowPointer(const(Window) window)
Undocumented in source. Be warned that the author may not have intended to support it.

From RenderTarget

view
View view [@property setter]
View view [@property getter]

The current active view.

getDefaultView
View getDefaultView()

Get the default view of the render target.

getSize
Vector2u getSize()

Return the size of the rendering region of the target.

getViewport
IntRect getViewport(View view)

Get the viewport of a view, applied to this render target.

clear
void clear(Color color)

Clear the entire target with a single color.

draw
void draw(Drawable drawable, RenderStates states)

Draw a drawable object to the render target.

draw
void draw(const(Vertex)[] vertices, PrimitiveType type, RenderStates states)

Draw primitives defined by an array of vertices.

mapPixelToCoords
Vector2f mapPixelToCoords(Vector2i point)

Convert a point fom target coordinates to world coordinates, using the current view.

mapPixelToCoords
Vector2f mapPixelToCoords(Vector2i point, View theView)

Convert a point from target coordinates to world coordinates.

mapCoordsToPixel
Vector2i mapCoordsToPixel(Vector2f point)

Convert a point from target coordinates to world coordinates, using the curtheView.view.

mapCoordsToPixel
Vector2i mapCoordsToPixel(Vector2f point, View theView)

Convert a point from world coordinates to target coordinates.

popGLStates
void popGLStates()

Restore the previously saved OpenGL render states and matrices.

pushGLStates
void pushGLStates()

Save the current OpenGL render states and matrices.

resetGLStates
void resetGLStates()

Reset the internal OpenGL states so that the target is ready for drawing.

Meta