Raylib C++  1.0.0
Encapsulates the raylib library
Public Member Functions | Static Public Member Functions | List of all members
raylib::window::RlWindow Class Reference

Encapsulation of the raylib functions to create a Window. More...

#include <RlWindow.hpp>

Collaboration diagram for raylib::window::RlWindow:
Collaboration graph

Public Member Functions

 RlWindow ()
 
 ~RlWindow ()
 Destroy the RlWindow. More...
 
void createWindow (const std::string &title, int width, int height, int fps=60)
 Create a window with the given title, width and height. More...
 
bool isOpen ()
 Check if the window is open. More...
 
bool isReady ()
 Check if window has been initialized successfully. More...
 
bool isFullScreen ()
 Check if window is currently fullscreen. More...
 
bool isHidden ()
 Check if window is currently hidden (only PLATFORM_DESKTOP) More...
 
bool isMinimized ()
 Check if window is currently minimized (only PLATFORM_DESKTOP) More...
 
bool isMaximized ()
 Check if window is currently maximized (only PLATFORM_DESKTOP) More...
 
bool isFocused ()
 Check if window is currently focused (only PLATFORM_DESKTOP) More...
 
bool isResized ()
 Check if window has been resized last frame. More...
 
bool hasState (const ConfigFlags &flag)
 Check if one specific window flag is enabled. More...
 
void setState (unsigned int flags)
 Set window configuration state using flags. More...
 
void setConfigFlags (unsigned int flags)
 Set window configuration state using flags. More...
 
void clearState (unsigned int flags)
 Clear window configuration state flags. More...
 
void toggleFullscreen ()
 Toggle window state: fullscreen/windowed (only PLATFORM_DESKTOP) More...
 
void maximize ()
 Set window state: maximized, if resizable (only PLATFORM_DESKTOP) More...
 
void minimize ()
 Set window state: minimized, if resizable (only PLATFORM_DESKTOP) More...
 
void restore ()
 Set window state: not minimized/maximized (only PLATFORM_DESKTOP) More...
 
void setIcon (const image::RlImage &image)
 Set icon for window (only PLATFORM_DESKTOP) More...
 
void setTitle (const std::string &title)
 Set title for window (only PLATFORM_DESKTOP) More...
 
void setPosition (int x, int y)
 Set window position on screen (only PLATFORM_DESKTOP) More...
 
void setMonitor (int monitor)
 Set monitor for the current window (fullscreen mode) More...
 
void setMinSize (int width, int height)
 Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE) More...
 
void setSize (int width, int height)
 Set window dimensions. More...
 
void takeScreenshot (const std::string &fileName)
 Take a screenshot of the current window. More...
 
const std::string & getTitle () const
 Get the window title. More...
 
const int & getWidth () const
 Get the window width. More...
 
const int & getHeight () const
 Get the window height. More...
 
const int & getMinWidth () const
 Get the window minimum width. More...
 
const int & getMinHeight () const
 Get the window minimum height. More...
 
const bool & isIsCreated () const
 Check if the window is created. More...
 
raylib::RlCameragetCamera ()
 Get the window mutable RlCamera. More...
 
const raylib::RlCameragetCamera () const
 Get the window immutable RlCamera. More...
 
void setCamera (const RlCamera &camera)
 Set the window RlCamera. More...
 
void setIsOpen (const bool &isOpen)
 Set if the window should be closed. More...
 

Static Public Member Functions

static std::shared_ptr< RlWindow > & getInstance ()
 Get the singleton instance of the RlWindow. More...
 

Detailed Description

Encapsulation of the raylib functions to create a Window.

Constructor & Destructor Documentation

◆ RlWindow()

raylib::window::RlWindow::RlWindow ( )

◆ ~RlWindow()

raylib::window::RlWindow::~RlWindow ( )

Destroy the RlWindow.

Member Function Documentation

◆ clearState()

void raylib::window::RlWindow::clearState ( unsigned int  flags)

Clear window configuration state flags.

Parameters
flagsthe flags to clear (
See also
ConfigFlags enum)

◆ createWindow()

void raylib::window::RlWindow::createWindow ( const std::string &  title,
int  width,
int  height,
int  fps = 60 
)

Create a window with the given title, width and height.

Parameters
titlethe title of the window
heightthe height of the window
widththe width of the window
fpsthe frame rate limit of the window
Exceptions
WindowExceptionif the window has already been created
Here is the call graph for this function:

◆ getCamera() [1/2]

const raylib::RlCamera & raylib::window::RlWindow::getCamera ( )

Get the window mutable RlCamera.

Returns
the window mutable RlCamera

◆ getCamera() [2/2]

const raylib::RlCamera& raylib::window::RlWindow::getCamera ( ) const

Get the window immutable RlCamera.

Returns
the window immutable RlCamera

◆ getHeight()

const int & raylib::window::RlWindow::getHeight ( ) const

Get the window height.

Returns
the window height

◆ getInstance()

std::shared_ptr< raylib::window::RlWindow > & raylib::window::RlWindow::getInstance ( )
static

Get the singleton instance of the RlWindow.

Returns
the singleton instance of the RlWindow
Here is the caller graph for this function:

◆ getMinHeight()

const int & raylib::window::RlWindow::getMinHeight ( ) const

Get the window minimum height.

Returns
the window minimum height

◆ getMinWidth()

const int & raylib::window::RlWindow::getMinWidth ( ) const

Get the window minimum width.

Returns
the window minimum width

◆ getTitle()

const std::string & raylib::window::RlWindow::getTitle ( ) const

Get the window title.

Returns
the window title

◆ getWidth()

const int & raylib::window::RlWindow::getWidth ( ) const

Get the window width.

Returns
the window width

◆ hasState()

bool raylib::window::RlWindow::hasState ( const ConfigFlags &  flag)

Check if one specific window flag is enabled.

Parameters
flagthe flag to check (
See also
ConfigFlags enum)
Returns
true if the flag is enabled, false otherwise

◆ isFocused()

bool raylib::window::RlWindow::isFocused ( )

Check if window is currently focused (only PLATFORM_DESKTOP)

Returns
true if the window is focused, false otherwise

◆ isFullScreen()

bool raylib::window::RlWindow::isFullScreen ( )

Check if window is currently fullscreen.

Returns
true if the window is fullscreen, false otherwise

◆ isHidden()

bool raylib::window::RlWindow::isHidden ( )

Check if window is currently hidden (only PLATFORM_DESKTOP)

Returns
true if the window is hidden, false otherwise

◆ isIsCreated()

const bool & raylib::window::RlWindow::isIsCreated ( ) const

Check if the window is created.

Returns
true if the window is created, false otherwise

◆ isMaximized()

bool raylib::window::RlWindow::isMaximized ( )

Check if window is currently maximized (only PLATFORM_DESKTOP)

Returns
true if the window is maximized, false otherwise

◆ isMinimized()

bool raylib::window::RlWindow::isMinimized ( )

Check if window is currently minimized (only PLATFORM_DESKTOP)

Returns
true if the window is minimized, false otherwise

◆ isOpen()

bool raylib::window::RlWindow::isOpen ( )

Check if the window is open.

Returns
true if the window is open, false if close icon has been pressed

◆ isReady()

bool raylib::window::RlWindow::isReady ( )

Check if window has been initialized successfully.

Returns
true if the window has been initialized successfully, false otherwise

◆ isResized()

bool raylib::window::RlWindow::isResized ( )

Check if window has been resized last frame.

Returns
true if the window has been resized, false otherwise

◆ maximize()

void raylib::window::RlWindow::maximize ( )

Set window state: maximized, if resizable (only PLATFORM_DESKTOP)

◆ minimize()

void raylib::window::RlWindow::minimize ( )

Set window state: minimized, if resizable (only PLATFORM_DESKTOP)

◆ restore()

void raylib::window::RlWindow::restore ( )

Set window state: not minimized/maximized (only PLATFORM_DESKTOP)

◆ setCamera()

void raylib::window::RlWindow::setCamera ( const RlCamera camera)

Set the window RlCamera.

Parameters
camerathe window RlCamera

◆ setConfigFlags()

void raylib::window::RlWindow::setConfigFlags ( unsigned int  flags)

Set window configuration state using flags.

Parameters
flagsthe flags to set (
See also
ConfigFlags enum)

◆ setIcon()

void raylib::window::RlWindow::setIcon ( const image::RlImage image)

Set icon for window (only PLATFORM_DESKTOP)

Parameters
imagethe image to set as icon
Here is the call graph for this function:

◆ setIsOpen()

void raylib::window::RlWindow::setIsOpen ( const bool &  isOpen)

Set if the window should be closed.

Parameters
isOpenfalse if the window should be closed, true otherwise

◆ setMinSize()

void raylib::window::RlWindow::setMinSize ( int  width,
int  height 
)

Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE)

Parameters
widththe minimum width
heightthe minimum height

◆ setMonitor()

void raylib::window::RlWindow::setMonitor ( int  monitor)

Set monitor for the current window (fullscreen mode)

Parameters
monitorthe monitor to set

◆ setPosition()

void raylib::window::RlWindow::setPosition ( int  x,
int  y 
)

Set window position on screen (only PLATFORM_DESKTOP)

Parameters
xthe x position
ythe y position

◆ setSize()

void raylib::window::RlWindow::setSize ( int  width,
int  height 
)

Set window dimensions.

Parameters
widththe width
heightthe height

◆ setState()

void raylib::window::RlWindow::setState ( unsigned int  flags)

Set window configuration state using flags.

Parameters
flagsthe flags to set (
See also
ConfigFlags enum)

◆ setTitle()

void raylib::window::RlWindow::setTitle ( const std::string &  title)

Set title for window (only PLATFORM_DESKTOP)

Parameters
titlethe title to set

◆ takeScreenshot()

void raylib::window::RlWindow::takeScreenshot ( const std::string &  fileName)

Take a screenshot of the current window.

Parameters
fileNamethe file name to save the screenshot

◆ toggleFullscreen()

void raylib::window::RlWindow::toggleFullscreen ( )

Toggle window state: fullscreen/windowed (only PLATFORM_DESKTOP)


The documentation for this class was generated from the following files: