raylib-cpp
C++ object-oriented wrapper library for raylib.
|
Window and Graphics Device Functions. More...
Public Member Functions | |
Window () | |
Build a Window object, but defer the initialization. More... | |
Window (int width, int height, const std::string &title="raylib", unsigned int flags=0) | |
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. | |
void | DrawFPS (int posX=10, int posY=10) const |
Draw current FPS. | |
Window & | EndDrawing () |
End canvas drawing and swap buffers (double buffering) | |
const std::string | GetClipboardText () |
Get clipboard text content. | |
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. | |
Vector2 | GetPosition () const |
Get window position XY on monitor. | |
int | GetRenderHeight () const |
Get current render height (it considers HiDPI) | |
int | GetRenderWidth () const |
Get current render width (it considers HiDPI) | |
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. | |
void | Init (int width=800, int height=450, const std::string &title="raylib", unsigned int flags=0) |
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) | |
void | SetClipboardText (const std::string &text) |
Set clipboard text content. | |
void | SetConfigFlags (unsigned int flags) |
Sets the configuration flags for raylib. More... | |
void | SetExitKey (int key) |
Set a custom key to exit program (default is ESC) | |
Window & | SetFocused () |
Set window focused (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 & | SetIcons (Image *images, int count) |
Set icon for window (multiple images, RGBA 32bit, only PLATFORM_DESKTOP) | |
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 & | SetOpacity (float opacity) |
Set window opacity [0.0f..1.0f] (only PLATFORM_DESKTOP) | |
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 & | ToggleBorderless () |
Toggle window state: borderless/windowed. | |
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 14 of file Window.hpp.
|
inline |
Build a Window object, but defer the initialization.
Ensure you call Init() manually.
Definition at line 21 of file Window.hpp.
|
inline |
Initialize window and OpenGL context.
width | The width of the window. |
height | The height of the window. |
title | The desired title of the window. |
flags | The ConfigFlags to set prior to initializing the window. See SetConfigFlags for more details. |
raylib::RaylibException | Thrown if the window failed to initiate. |
Definition at line 38 of file Window.hpp.
References Init().
|
inline |
Initializes the window.
width | The width of the window. |
height | The height of the window. |
title | The desired title of the window. |
flags | The ConfigFlags to set prior to initializing the window. See SetConfigFlags for more details. |
raylib::RaylibException | Thrown if the window failed to initiate. |
Definition at line 60 of file Window.hpp.
References raylib::InitWindow(), and SetConfigFlags().
Referenced by Window().
|
inline |
Sets the configuration flags for raylib.
flags | The ConfigFlags to apply to the configuration. |
Definition at line 409 of file Window.hpp.
Referenced by Init().