Axle 0.1.0
A simple, lightweight C++ game framework built on top of Raylib.
 
Loading...
Searching...
No Matches
Axle::Window Class Reference

Represents a window that can be created and managed by the engine. More...

#include <window.h>

Public Member Functions

 Window (int width, int height, const char *title)
 Initialize window and OpenGL context.
 
void close ()
 Close window and unload OpenGL context.
 
bool shouldClose ()
 Checks if aplication should close (KEY_ESCAPE pressed or window close icon clicked).
 
void setTargetFPS (int fps)
 Sets the maximum frames per second that the window should render.
 
int getTargetFPS ()
 Returns the maximum frames per second that the window should render.
 
void beginDrawing ()
 Setup the windows to start drawing.
 
void endDrawing ()
 Finish the drawing process and swap the buffers.
 
void clearBackground (unsigned char r, unsigned char g, unsigned char b, unsigned char a)
 Clear the window with a specific color.
 
void clearBackground (Color color)
 Clear the window with a specific color.
 
void drawText (const char *text, int x, int y, int fontSize, unsigned char r, unsigned char g, unsigned char b, unsigned char a)
 Draw some text on the window, using the default font.
 
void drawText (const char *text, int x, int y, int fontSize, Color color)
 Draw some text on the window, using the default font.
 

Detailed Description

Represents a window that can be created and managed by the engine.

Constructor & Destructor Documentation

◆ Window()

Axle::Window::Window ( int width,
int height,
const char * title )

Initialize window and OpenGL context.

Parameters
widthThe width of the window.
heightThe height of the window.
titleThe title of the window.

Member Function Documentation

◆ clearBackground() [1/2]

void Axle::Window::clearBackground ( Color color)

Clear the window with a specific color.

Parameters
colorThe color to be used to clear the window.

◆ clearBackground() [2/2]

void Axle::Window::clearBackground ( unsigned char r,
unsigned char g,
unsigned char b,
unsigned char a )

Clear the window with a specific color.

Parameters
rThe red component of the color.
gThe green component of the color.
bThe blue component of the color.
aThe alpha component of the color.

◆ drawText() [1/2]

void Axle::Window::drawText ( const char * text,
int x,
int y,
int fontSize,
Color color )

Draw some text on the window, using the default font.

Parameters
textThe text to be drawn
xThe x position of the text
yThe y position of the text
fontSizeThe size of the font.
colorThe color preset to be used.

◆ drawText() [2/2]

void Axle::Window::drawText ( const char * text,
int x,
int y,
int fontSize,
unsigned char r,
unsigned char g,
unsigned char b,
unsigned char a )

Draw some text on the window, using the default font.

Parameters
textThe text to be drawn
xThe x position of the text
yThe y position of the text
fontSizeThe size of the font.
rThe red component of the color.
gThe green component of the color.
bThe blue component of the color.
aThe alpha component of the color.

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