raylib-cpp
C++ object-oriented wrapper library for raylib.
Public Member Functions | Static Public Member Functions | List of all members
raylib::Window Class Reference

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 ()
 
Window & BeginDrawing ()
 
void Close ()
 Close window and unload OpenGL context. More...
 
Window & EndDrawing ()
 
std::string GetClipboardText ()
 
int GetFPS ()
 
float GetFrameTime ()
 
void * GetHandle ()
 
std::string GetMonitorName (int monitor)
 
Vector2 GetPosition ()
 
Vector2 GetScaleDPI ()
 
int GetScreenHeight ()
 
int GetScreenWidth ()
 
double GetTime ()
 
Window & Hide ()
 
void Init (int width, int height, const std::string &title)
 
bool IsCursorOnScreen ()
 
bool IsFocused ()
 
bool IsFullscreen ()
 
bool IsHidden ()
 
bool IsMinimized ()
 
bool IsResized ()
 
Window & SetClipboardText (const std::string &text)
 
Window & SetIcon (Image image)
 
Window & SetMinSize (int width, int height)
 
Window & SetMonitor (int monitor)
 
Window & SetPosition (int x, int y)
 
Window & SetSize (int width, int height)
 
Window & SetTargetFPS (int fps)
 
Window & SetTitle (const std::string &title)
 
bool ShouldClose ()
 Check if KEY_ESCAPE pressed or Close icon pressed. More...
 
Window & ToggleFullscreen ()
 
Window & Unhide ()
 

Static Public Member Functions

static bool IsReady ()
 Check if window has been initialized successfully. More...
 

Detailed Description

Window and Graphics Device Functions.

raylib::Window w(640, 480, "raylib-cpp");
while (!w.ShouldClose()) {
// Update
}

Definition at line 26 of file Window.hpp.

Constructor & Destructor Documentation

◆ Window()

raylib::Window::Window ( int  width = 800,
int  height = 450,
const std::string &  title = "raylib",
bool  lateInit = false 
)
inline

Initialize window and OpenGL context.

Definition at line 31 of file Window.hpp.

References Init().

◆ ~Window()

raylib::Window::~Window ( )
inline

Definition at line 37 of file Window.hpp.

References Close().

Member Function Documentation

◆ BeginDrawing()

Window& raylib::Window::BeginDrawing ( )
inline

Definition at line 125 of file Window.hpp.

◆ Close()

void raylib::Window::Close ( )
inline

Close window and unload OpenGL context.

Definition at line 55 of file Window.hpp.

Referenced by ~Window().

◆ EndDrawing()

Window& raylib::Window::EndDrawing ( )
inline

Definition at line 129 of file Window.hpp.

◆ GetClipboardText()

std::string raylib::Window::GetClipboardText ( )
inline

Definition at line 154 of file Window.hpp.

◆ GetFPS()

int raylib::Window::GetFPS ( )
inline

Definition at line 167 of file Window.hpp.

◆ GetFrameTime()

float raylib::Window::GetFrameTime ( )
inline

Definition at line 170 of file Window.hpp.

◆ GetHandle()

void* raylib::Window::GetHandle ( )
inline

Definition at line 121 of file Window.hpp.

◆ GetMonitorName()

std::string raylib::Window::GetMonitorName ( int  monitor)
inline

Definition at line 150 of file Window.hpp.

◆ GetPosition()

Vector2 raylib::Window::GetPosition ( )
inline

Definition at line 142 of file Window.hpp.

◆ GetScaleDPI()

Vector2 raylib::Window::GetScaleDPI ( )
inline

Definition at line 146 of file Window.hpp.

◆ GetScreenHeight()

int raylib::Window::GetScreenHeight ( )
inline

Definition at line 138 of file Window.hpp.

◆ GetScreenWidth()

int raylib::Window::GetScreenWidth ( )
inline

Definition at line 134 of file Window.hpp.

◆ GetTime()

double raylib::Window::GetTime ( )
inline

Definition at line 173 of file Window.hpp.

◆ Hide()

Window& raylib::Window::Hide ( )
inline

Definition at line 93 of file Window.hpp.

◆ Init()

void raylib::Window::Init ( int  width,
int  height,
const std::string &  title 
)
inline

Definition at line 41 of file Window.hpp.

Referenced by Window().

◆ IsCursorOnScreen()

bool raylib::Window::IsCursorOnScreen ( )
inline

Definition at line 59 of file Window.hpp.

◆ IsFocused()

bool raylib::Window::IsFocused ( )
inline

Definition at line 72 of file Window.hpp.

◆ IsFullscreen()

bool raylib::Window::IsFullscreen ( )
inline

Definition at line 82 of file Window.hpp.

◆ IsHidden()

bool raylib::Window::IsHidden ( )
inline

Definition at line 78 of file Window.hpp.

◆ IsMinimized()

bool raylib::Window::IsMinimized ( )
inline

Definition at line 69 of file Window.hpp.

◆ IsReady()

static bool raylib::Window::IsReady ( )
inlinestatic

Check if window has been initialized successfully.

Definition at line 66 of file Window.hpp.

◆ IsResized()

bool raylib::Window::IsResized ( )
inline

Definition at line 75 of file Window.hpp.

◆ SetClipboardText()

Window& raylib::Window::SetClipboardText ( const std::string &  text)
inline

Definition at line 158 of file Window.hpp.

◆ SetIcon()

Window& raylib::Window::SetIcon ( Image  image)
inline

Definition at line 97 of file Window.hpp.

◆ SetMinSize()

Window& raylib::Window::SetMinSize ( int  width,
int  height 
)
inline

Definition at line 113 of file Window.hpp.

◆ SetMonitor()

Window& raylib::Window::SetMonitor ( int  monitor)
inline

Definition at line 109 of file Window.hpp.

◆ SetPosition()

Window& raylib::Window::SetPosition ( int  x,
int  y 
)
inline

Definition at line 105 of file Window.hpp.

◆ SetSize()

Window& raylib::Window::SetSize ( int  width,
int  height 
)
inline

Definition at line 117 of file Window.hpp.

◆ SetTargetFPS()

Window& raylib::Window::SetTargetFPS ( int  fps)
inline

Definition at line 163 of file Window.hpp.

◆ SetTitle()

Window& raylib::Window::SetTitle ( const std::string &  title)
inline

Definition at line 101 of file Window.hpp.

◆ ShouldClose()

bool raylib::Window::ShouldClose ( )
inline

Check if KEY_ESCAPE pressed or Close icon pressed.

Definition at line 48 of file Window.hpp.

◆ ToggleFullscreen()

Window& raylib::Window::ToggleFullscreen ( )
inline

Definition at line 85 of file Window.hpp.

◆ Unhide()

Window& raylib::Window::Unhide ( )
inline

Definition at line 89 of file Window.hpp.

raylib::Window
Window and Graphics Device Functions.
Definition: Window.hpp:26