P-E-R-R-Y
Utilitaires, contrats et vendors du moteur, en une seule doc
Loading...
Searching...
No Matches
RayWindow Class Reference

Raylib Window class - a single concrete class implementing IWindow3 fully (which already IS-A IWindow2 IS-A IWindow via the interface chain), matching raylib itself : one native window, no separate 2D/3D window objects. More...

#include <RayWindow.hpp>

Inheritance diagram for RayWindow:
Collaboration diagram for RayWindow:

Public Member Functions

 RayWindow (int32_t screenWidth, int32_t screenHeight, std::string title)
 ~RayWindow ()
bool isOpen () override
 notice if the window is open
void close () override
 close the window
Vector2f getPosition () override
 Where the window sits on the desktop, in pixels, origin top-left of the primary screen.
void setPosition (Vector2f position) override
 Move the window on the desktop.
Vector2f getSize () override
 The drawable area, in pixels - NOT the desktop size. A hit-test built on IMouse::getPosition() compares against this one.
void setSize (Vector2f size) override
 Resize the drawable area.
void setFrameLimit (int32_t limit) override
 Set the Frame Limit object.
void setMouseVisibility (bool visible) override
 Show or hide the system cursor over THIS window.
int32_t getDelta () override
 Get the Delta object.
bool pollEvent () override
 raylib has NO event queue : only state queries, refreshed once per frame by PollInputEvents() inside EndDrawing().
void eventClose () override
 notice the window that a close was requested
void beginDraw () override
 allowing to draw 2D on the window
void endDraw () override
 end the 2D drawing
void drawPoly (graphic::IPolygon *polygon) override
 draw a polygon
void drawSprite (graphic::ISprite *sprite) override
 draw a sprite
void drawText (graphic::IText *text) override
 draw a text
void beginMode3 (graphic::ICamera *camera) override
 allowing to draw 3D on the window
void drawModel (graphic::IModel *model) override
 draw a model
void drawText3D (graphic::IText *text, Vector3f position) override
 draw text at a 3D world position - the same IText used by drawText(), just projected through the active camera instead of drawn at a screen-space position.
void endMode3 () override
 end the 3D drawing
Public Member Functions inherited from graphic::IWindow3
virtual ~IWindow3 ()=default
Public Member Functions inherited from graphic::IWindow2
virtual ~IWindow2 ()=default
Public Member Functions inherited from graphic::IWindow
virtual ~IWindow ()=default
 Destroy the IWindow object.

Detailed Description

Raylib Window class - a single concrete class implementing IWindow3 fully (which already IS-A IWindow2 IS-A IWindow via the interface chain), matching raylib itself : one native window, no separate 2D/3D window objects.

raylib switches to 3D through a global mode (BeginMode3D), not through a second object : splitting into three C++ types would describe nothing real. The active camera is held between beginMode3() and endMode3().

Constructor & Destructor Documentation

◆ RayWindow()

RayWindow::RayWindow ( int32_t screenWidth,
int32_t screenHeight,
std::string title )
inline

◆ ~RayWindow()

RayWindow::~RayWindow ( )
inline

Member Function Documentation

◆ beginDraw()

void RayWindow::beginDraw ( )
inlineoverridevirtual

allowing to draw 2D on the window

Implements graphic::IWindow2.

◆ close()

void RayWindow::close ( )
inlineoverridevirtual

close the window

Implements graphic::IWindow.

◆ endDraw()

void RayWindow::endDraw ( )
inlineoverridevirtual

end the 2D drawing

Implements graphic::IWindow2.

◆ eventClose()

void RayWindow::eventClose ( )
inlineoverridevirtual

notice the window that a close was requested

Implements graphic::IWindow.

◆ getDelta()

int32_t RayWindow::getDelta ( )
inlineoverridevirtual

Get the Delta object.

Returns
__int32_t

Implements graphic::IWindow.

◆ getPosition()

Vector2f RayWindow::getPosition ( )
inlineoverridevirtual

Where the window sits on the desktop, in pixels, origin top-left of the primary screen.

Returns
Vector2f

Implements graphic::IWindow.

◆ getSize()

Vector2f RayWindow::getSize ( )
inlineoverridevirtual

The drawable area, in pixels - NOT the desktop size. A hit-test built on IMouse::getPosition() compares against this one.

Returns
Vector2f

Implements graphic::IWindow.

◆ isOpen()

bool RayWindow::isOpen ( )
inlineoverridevirtual

notice if the window is open

Returns
bool

Implements graphic::IWindow.

◆ pollEvent()

bool RayWindow::pollEvent ( )
inlineoverridevirtual

raylib has NO event queue : only state queries, refreshed once per frame by PollInputEvents() inside EndDrawing().

There is nothing to drain here, and nothing to guard against a second caller : the state is already frozen for the frame and every read is idempotent.

It answers true always, because raylib has no way to tell whether anything happened. Harmless as long as only the fronts sit inside the condition - with no event they are false anyway. See IWindow.

Implements graphic::IWindow.

◆ setFrameLimit()

void RayWindow::setFrameLimit ( int32_t limit)
inlineoverridevirtual

Set the Frame Limit object.

Parameters
limit

Implements graphic::IWindow.

◆ setMouseVisibility()

void RayWindow::setMouseVisibility ( bool visible)
inlineoverridevirtual

Show or hide the system cursor over THIS window.

For any game that draws its own pointer - a crosshair, a selection ring - where the native arrow sitting on top of it is just a second, wrong cursor.

Scoped to the window, not to the desktop : leaving it puts the arrow back, and closing the window can never strand the user without a pointer. Vendors whose cursor is process-wide (raylib) restore it on close for the same reason.

Hiding does NOT capture the mouse : IMouse::getPosition() keeps answering, and the pointer still leaves the window normally.

Parameters
visible

Implements graphic::IWindow.

◆ setPosition()

void RayWindow::setPosition ( Vector2f position)
inlineoverridevirtual

Move the window on the desktop.

Parameters
position

Implements graphic::IWindow.

◆ setSize()

void RayWindow::setSize ( Vector2f size)
inlineoverridevirtual

Resize the drawable area.

Parameters
size

Implements graphic::IWindow.


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