ASW Lib
A.D.S. Games SDL Wrapper Library. A library targeted at Allegro4 users who want to switch to SDL3 and use modern c++.
Loading...
Searching...
No Matches
asw::display Namespace Reference

Functions

void setTitle (const std::string &title)
 Set the title of the window.
 
void setIcon (const std::string &path)
 Set the icon to display on the window. If it does not exist, this will silently fail.
 
void setFullscreen (bool fullscreen)
 Set the window to fullscreen or windowed.
 
void setResolution (int w, int h)
 Set the resolution of the window.
 
void setResizable (bool resizable)
 Set resizable flag of the window.
 
SDL_Point getSize ()
 Get the size of the window.
 
SDL_Point getLogicalSize ()
 Get the logical size of the window. This may differ from the actual size if scaling is enabled.
 
SDL_FPoint getScale ()
 Get the scale of the window. This is equivalent to the logical size divided by the actual size.
 
void setRenderTarget (const asw::Texture &texture)
 Set the render target to the window.
 
void resetRenderTarget ()
 Reset the render target to the default.
 
void clear ()
 Clear the window.
 
void present ()
 Present the window.
 

Variables

asw::Rendererrenderer = nullptr
 The renderer for the display module.
 
asw::Windowwindow = nullptr
 The window for the display module.
 

Function Documentation

◆ clear()

void asw::display::clear ( )

Clear the window.

Definition at line 65 of file display.cpp.

◆ getLogicalSize()

SDL_Point asw::display::getLogicalSize ( )

Get the logical size of the window. This may differ from the actual size if scaling is enabled.

Returns
The logical size of the window.

Definition at line 44 of file display.cpp.

◆ getScale()

SDL_FPoint asw::display::getScale ( )

Get the scale of the window. This is equivalent to the logical size divided by the actual size.

Returns
The scale of the window.

Definition at line 51 of file display.cpp.

◆ getSize()

SDL_Point asw::display::getSize ( )

Get the size of the window.

Returns
The size of the window.

Definition at line 38 of file display.cpp.

◆ present()

void asw::display::present ( )

Present the window.

Definition at line 69 of file display.cpp.

◆ resetRenderTarget()

void asw::display::resetRenderTarget ( )

Reset the render target to the default.

Definition at line 61 of file display.cpp.

◆ setFullscreen()

void asw::display::setFullscreen ( bool fullscreen)

Set the window to fullscreen or windowed.

Parameters
fullscreenWhether or not to set the window to fullscreen.

Definition at line 26 of file display.cpp.

◆ setIcon()

void asw::display::setIcon ( const std::string & path)

Set the icon to display on the window. If it does not exist, this will silently fail.

Parameters
pathA path to the icon to display.

Definition at line 16 of file display.cpp.

◆ setRenderTarget()

void asw::display::setRenderTarget ( const asw::Texture & texture)

Set the render target to the window.

Definition at line 57 of file display.cpp.

◆ setResizable()

void asw::display::setResizable ( bool resizable)

Set resizable flag of the window.

Parameters
resizableWhether or not the window is resizable.

Definition at line 34 of file display.cpp.

◆ setResolution()

void asw::display::setResolution ( int w,
int h )

Set the resolution of the window.

Parameters
wThe width of the window.
hThe height of the window.

Definition at line 30 of file display.cpp.

◆ setTitle()

void asw::display::setTitle ( const std::string & title)

Set the title of the window.

Parameters
titleThe title to display at the top of the window.

Definition at line 12 of file display.cpp.

Variable Documentation

◆ renderer

asw::Renderer * asw::display::renderer = nullptr
extern

The renderer for the display module.

Definition at line 9 of file display.cpp.

◆ window

asw::Window * asw::display::window = nullptr
extern

The window for the display module.

Definition at line 10 of file display.cpp.