SDL2Window

SDL Window wrapper. There is two ways to receive events, either by polling a SDL2 object, or by overriding the event callbacks.

Constructors

this
this(SDL2 sdl2, int x, int y, int width, int height, int flags)

Creates a SDL window which targets a window.

Destructor

~this
~this()

Members

Functions

close
void close()

Releases the SDL resource.

getHeight
int getHeight()
getPosition
SDL_Point getPosition()
getSize
SDL_Point getSize()
getWidth
int getWidth()
getWindowInfo
SDL_SysWMinfo getWindowInfo()
getX
int getX()
getY
int getY()
hide
void hide()
id
int id()
maximize
void maximize()
minimize
void minimize()
onClose
void onClose()
onEnter
void onEnter()
onExposed
void onExposed()
onFocusGained
void onFocusGained()
onFocusLost
void onFocusLost()
onHide
void onHide()
onKeyDown
void onKeyDown(uint timestamp, SDL2Keyboard keyboard, SDL_Keycode key)
Undocumented in source. Be warned that the author may not have intended to support it.
onKeyUp
void onKeyUp(uint timestamp, SDL2Keyboard keyboard, SDL_Keycode key)
Undocumented in source. Be warned that the author may not have intended to support it.
onLeave
void onLeave()
onMaximized
void onMaximized()
onMinimized
void onMinimized()
onMouseButtonPressed
void onMouseButtonPressed(uint timestamp, SDL2Mouse mouseState, int button, bool isDoubleClick)
Undocumented in source. Be warned that the author may not have intended to support it.
onMouseButtonReleased
void onMouseButtonReleased(uint timestamp, SDL2Mouse mouseState, int button)
Undocumented in source. Be warned that the author may not have intended to support it.
onMouseMove
void onMouseMove(uint timestamp, SDL2Mouse mouseState)
Undocumented in source. Be warned that the author may not have intended to support it.
onMouseWheel
void onMouseWheel(uint timestamp, SDL2Mouse mouseState, int wheelDeltaX, int wheelDeltaY)
Undocumented in source. Be warned that the author may not have intended to support it.
onMove
void onMove(int x, int y)
onResized
void onResized(int width, int height)
onRestored
void onRestored()
onShow
void onShow()
onSizeChanged
void onSizeChanged()
setFullscreen
deprecated void setFullscreen(bool fullscreen)
setFullscreenSetting
void setFullscreenSetting(uint flags)
setIcon
void setIcon(SDL2Surface icon)
setPosition
void setPosition(int positionX, int positionY)
setSize
void setSize(int width, int height)
setTitle
void setTitle(string title)
show
void show()
surface
SDL2Surface surface()
swapBuffers
void swapBuffers()

Swap OpenGL buffers.

updateSurface
void updateSurface()

Submit changes to the window surface.

Variables

_sdl2
SDL2 _sdl2;
Undocumented in source.
_window
SDL_Window* _window;
Undocumented in source.

Inherited Members

From KeyboardListener

onKeyDown
void onKeyDown(uint timestamp, SDL2Keyboard keyboard, SDL_Keycode key)

Called whenever a keyboard button is pressed.

onKeyUp
void onKeyUp(uint timestamp, SDL2Keyboard keyboard, SDL_Keycode key)

Called whenever a keyboard button is released.

From MouseListener

onMouseMove
void onMouseMove(uint timestamp, SDL2Mouse mouseState)

Called whenever the mouse moves.

onMouseButtonPressed
void onMouseButtonPressed(uint timestamp, SDL2Mouse mouseState, int button, bool isDoubleClick)

Called whenever a mouse button is pressed.

onMouseButtonReleased
void onMouseButtonReleased(uint timestamp, SDL2Mouse mouseState, int button)

Called whenever a mouse button is released.

onMouseWheel
void onMouseWheel(uint timestamp, SDL2Mouse mouseState, int wheelDeltaX, int wheelDeltaY)

Called whenever the mouse wheel is scrolled.

Meta