Window

Window is a rendering window where all drawable objects are drawn.

Note that the default clear-color is <code>Color.White</code> and the default Sync is <code>Window.Sync.Enable</code>.

Constructors

this
this(VideoMode vMode, string title, Style style, int x, int y)

CTor

Members

Enums

Style
enum Style

The specific window styles

Sync
enum Sync

The Window syncronisation mode. Default Syncronisation is <code>Sync.Enable</code>.

Functions

capture
Surface capture(Texture.Format fmt)

Capture the pixel data of the current window and returns a Surface with this pixel data. You can also alter the format of the pixel data. Default is <code>Texture.Format.BGRA</code>. This method is predestinated for screenshots.

clear
void clear()

Clears the buffer.

close
void close()

Close and destroy this window.

display
void display()

Make all changes visible on screen. If the framerate limit is not 0, it waits for (1000 / framerate limit) milliseconds.

draw
void draw(Drawable draw)

Draw a drawable object on screen.

draw
void draw(Renderer rtarget)

Draw a Renderer on the screen.

fetchPosition
void fetchPosition(int* x, int* y)

Fetch the current position if this window. The position is stored inside of the pointer. The pointer don't have to be null.

fetchSize
void fetchSize(int* w, int* h)
Undocumented in source.
getBrightness
float getBrightness()

Returns the brightness (gamma correction) for the window where 0.0 is completely dark and 1.0 is normal brightness.

getFramerateLimit
ubyte getFramerateLimit()

Returns the framerate limit for this window.

getPosition
Vector2s getPosition()

Returns the current position of the window.

getSize
int[2] getSize()
Undocumented in source. Be warned that the author may not have intended to support it.
getStyle
Style getStyle()

Returns the Window Style.

getTitle
string getTitle()

Returns the current title of the window.

getVerticalSync
Sync getVerticalSync()

Returns the current syncronisation mode.

getVideoMode
const(VideoMode) getVideoMode()

Returns the current VideoMode which hold the current width, the current height and the refresh rate. The first two can also be accessed with the 'width' and 'height' property.

hasKeyboardFocus
bool hasKeyboardFocus()

Returns if the keyboard focus is on this window.

hasMouseFocus
bool hasMouseFocus()

Returns if the mouse focus is on this window.

isFullscreen
bool isFullscreen()

Returns, if this Window is in fullscreen mode.

isGrabbed
bool isGrabbed()

Returns true, if input is grabbed.

isScreenSaverEnabled
bool isScreenSaverEnabled()

Returns if the screen saver is currently enabled, or not.

raise
void raise()

Raise the window. The window has after this call focus.

restore
void restore()

Restore the window.

setBrightness
bool setBrightness(float bright)

Set the brightness (gamma correction) for the window.

setClearColor
void setClearColor(Color col)

Set the color with which this windows clear his buffer. This is also the background color of the window.

setClearColor
void setClearColor(Color col)

Rvalue version

setClearColor
void setClearColor(float red, float green, float blue, float alpha)

Set the color with which this windows clear his buffer. This is also the background color of the window.

setFramerateLimit
void setFramerateLimit(ubyte fps)

Set the framerate limit for this window.

setFullscreen
void setFullscreen(int style)

Use this function to (re)set Window's fullscreen states. style may be Style.Fullscreen for "real" fullscreen with a videomode change or Style.Desktop for "fake" fullscreen that takes the size of the desktop Set 0 for windowed mode.

setGrabbed
void setGrabbed(bool enable)

When input is grabbed the mouse is confined to the window.

setIcon
void setIcon(Surface icon)

Set an icon for this window.

setPosition
void setPosition(short x, short y)

Set a new position to this window

setPosition
void setPosition(Vector2s vec)

Set a new position to this window

setScreenSaver
void setScreenSaver(bool enable)

Enable or Disable the screen saver.

setSize
void setSize(ushort width, ushort height)

Set a new size to this window

setTitle
string setTitle(string title)

Set a new title to this window

setVerticalSync
bool setVerticalSync(Sync sync)

Set the Syncronisation mode of this window. Default Syncronisation is <code>Sync.Enable</code>.

show
void show(bool show)

Show or hide the window. true shows, false hides.

toggleFullscreen
void toggleFullscreen()

Toggle between Fullscreen and windowed mode, depending on the current state.

Manifest constants

DefaultXPos
enum DefaultXPos;
Undocumented in source.
DefaultYPos
enum DefaultYPos;
Undocumented in source.
FullScreenMask
enum FullScreenMask;
Undocumented in source.

Properties

height
ushort height [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
id
uint id [@property getter]

Every window has an unique Id. This method returns this Id.

isOpen
bool isOpen [@property getter]

Check if this window is still opened.

width
ushort width [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

count
int count()

Returns how many windows exist

Static variables

DefaultTitle
string DefaultTitle;
Undocumented in source.

Meta

Authors

rschuett