|
le3d - LightEngine 3D
A straightforward C++ 3D software engine for real-time graphics
|
Create and handle an OS native window. More...
#include <window.h>
Public Types | |
| typedef void(* | KeyCallback) (int key, int state) |
| typedef void(* | MouseCallback) (int x, int y, int buttons) |
Public Member Functions | |
| LeWindow (const char *name, int width=LE_RESOX_DEFAULT, int height=LE_RESOY_DEFAULT, bool fullscreen=false) | |
| ~LeWindow () | |
| void | update () |
| Update window state and process events. More... | |
| void | setFullScreen () |
| Set the window to fullscreen mode. More... | |
| void | setWindowed () |
| Set the window to windowed mode. More... | |
| LeHandle | getHandle () |
| Retrieve the native OS window handle. More... | |
| LeDrawingContext | getContext () |
| Retrieve the native OS window graphic context. More... | |
| void | registerKeyCallback (KeyCallback callback) |
| Register a callback to receive keyboard events associated to the window. More... | |
| void | registerMouseCallback (MouseCallback callback) |
| Register a callback to receive mouse events associated to the window. More... | |
| void | sendKeyEvent (int code, int state) |
| Send a keyboard event to the window. More... | |
| void | sendMouseEvent (int x, int y, int buttons) |
| Send a mouse event to the window. More... | |
Public Attributes | |
| int | width |
| int | height |
| bool | fullScreen |
| bool | visible |
Create and handle an OS native window.
| typedef void(* LeWindow::KeyCallback) (int key, int state) |
| typedef void(* LeWindow::MouseCallback) (int x, int y, int buttons) |
| LeWindow::LeWindow | ( | const char * | name, |
| int | width = LE_RESOX_DEFAULT, |
||
| int | height = LE_RESOY_DEFAULT, |
||
| bool | fullscreen = false |
||
| ) |
| LeWindow::~LeWindow | ( | ) |
| LeDrawingContext LeWindow::getContext | ( | ) |
Retrieve the native OS window graphic context.
| LeHandle LeWindow::getHandle | ( | ) |
Retrieve the native OS window handle.
| void LeWindow::registerKeyCallback | ( | KeyCallback | callback | ) |
Register a callback to receive keyboard events associated to the window.
| [in] | callback | pointer to a callback function or NULL |
| void LeWindow::registerMouseCallback | ( | MouseCallback | callback | ) |
Register a callback to receive mouse events associated to the window.
| [in] | callback | pointer to a callback function or NULL |
| void LeWindow::sendKeyEvent | ( | int | code, |
| int | state | ||
| ) |
Send a keyboard event to the window.
| [in] | code | keyboard event code |
| [in] | state | keyboard event state (mask) |
| void LeWindow::sendMouseEvent | ( | int | x, |
| int | y, | ||
| int | buttons | ||
| ) |
Send a mouse event to the window.
| [in] | x | horizontal position of the mouse (in client area and in pixels) |
| [in] | y | vertical position of the mouse (in client area and in pixels) |
| [in] | buttons | buttons state (mask) |
| void LeWindow::setFullScreen | ( | ) |
Set the window to fullscreen mode.
| void LeWindow::setWindowed | ( | ) |
Set the window to windowed mode.
| void LeWindow::update | ( | ) |
Update window state and process events.
| bool LeWindow::fullScreen |
Fullscreen state of window
| int LeWindow::height |
Height of window client region (in pixels)
| bool LeWindow::visible |
Is the window open or closed
| int LeWindow::width |
Width of window client region (in pixels)
1.8.10