![]() |
raylib-cpp
C++ object-oriented wrapper library for raylib.
|
Window and Graphics Device Functions. More...
Public Member Functions | |
Window (int width=800, int height=450, const std::string &title="raylib", bool lateInit=false) | |
Initialize window and OpenGL context. More... | |
~Window () | |
Close window and unload OpenGL context. | |
Window & | BeginDrawing () |
Setup canvas (framebuffer) to start drawing. | |
Window & | ClearBackground (const ::Color &color=BLACK) |
Clear window with given color. | |
Window & | ClearState (unsigned int flag) |
Clear window configuration state flags. | |
void | Close () |
Close window and unload OpenGL context. | |
Window & | DrawFPS (int posX=10, int posY=10) |
Draw current FPS. | |
Window & | EndDrawing () |
End canvas drawing and swap buffers (double buffering) | |
int | GetFPS () const |
Returns current FPS. | |
float | GetFrameTime () const |
Returns time in seconds for last frame drawn. | |
void * | GetHandle () const |
Get native window handle. | |
int | GetHeight () const |
Get current screen height. | |
inline ::Vector2 | GetPosition () const |
Get window position XY on monitor. | |
inline ::Vector2 | GetScaleDPI () const |
Get window scale DPI factor. | |
Vector2 | GetSize () const |
Get the screen's width and height. | |
double | GetTime () const |
Returns elapsed time in seconds since InitWindow() | |
int | GetWidth () const |
Get current screen width. | |
bool | Init (int width=800, int height=450, const std::string &title="raylib") |
Initializes the window. More... | |
bool | IsCursorOnScreen () const |
Check if cursor is on the current screen. | |
bool | IsFocused () const |
Check if window is currently focused. | |
bool | IsFullscreen () const |
Check if window is currently fullscreen. | |
bool | IsHidden () const |
Check if window is currently hidden. | |
bool | IsMaximized () const |
Check if window is currently minimized. | |
bool | IsMinimized () const |
Check if window is currently minimized. | |
bool | IsResized () const |
Check if window has been resized last frame. | |
bool | IsState (unsigned int flag) const |
Check if one specific window flag is enabled. | |
Window & | Maximize () |
Set window state: maximized, if resizable (only PLATFORM_DESKTOP) | |
Window & | Minimize () |
Set window state: minimized, if resizable (only PLATFORM_DESKTOP) | |
Window & | Restore () |
Set window state: not minimized/maximized (only PLATFORM_DESKTOP) | |
Window & | SetFullscreen (bool fullscreen) |
Set whether or not the application should be fullscreen. | |
Window & | SetIcon (const ::Image &image) |
Set icon for window. | |
Window & | SetMinSize (const ::Vector2 &size) |
Set window minimum dimensions. | |
Window & | SetMinSize (int width, int height) |
Set window minimum dimensions. | |
Window & | SetMonitor (int monitor) |
Set monitor for the current window. | |
Window & | SetPosition (const ::Vector2 &position) |
Set window position on screen. | |
Window & | SetPosition (int x, int y) |
Set window position on screen. | |
Window & | SetSize (const ::Vector2 &size) |
Set window dimensions. | |
Window & | SetSize (int width, int height) |
Set window dimensions. | |
Window & | SetState (unsigned int flag) |
Set window configuration state using flags. | |
Window & | SetTargetFPS (int fps) |
Set target FPS (maximum) | |
Window & | SetTitle (const std::string &title) |
Set title for window. | |
bool | ShouldClose () const |
Check if KEY_ESCAPE pressed or Close icon pressed. | |
Window & | ToggleFullscreen () |
Toggle window state: fullscreen/windowed. | |
Static Public Member Functions | |
static bool | IsReady () |
Check if window has been initialized successfully. | |
Window and Graphics Device Functions.
Definition at line 13 of file Window.hpp.
|
inline |
Initialize window and OpenGL context.
raylib::RaylibException | Thrown if the window failed to initiate. |
Definition at line 20 of file Window.hpp.
References Init().
|
inline |
Initializes the window.
Definition at line 41 of file Window.hpp.
References raylib::InitWindow().
Referenced by Window().