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 set_title (const std::string &title)
 Set the title of the window.
 
void set_icon (const std::string &path)
 Set the icon to display on the window. If it does not exist, this will silently fail.
 
void set_fullscreen (bool fullscreen)
 Set the window to fullscreen or windowed.
 
void set_resolution (int w, int h)
 Set the resolution of the window.
 
void set_resizable (bool resizable)
 Set resizable flag of the window.
 
asw::Vec2< int > get_size ()
 Get the size of the window.
 
asw::Vec2< int > get_logical_size ()
 Get the logical size of the window. This may differ from the actual size if scaling is enabled.
 
asw::Vec2< float > get_scale ()
 Get the scale of the window. This is equivalent to the logical size divided by the actual size.
 
void set_render_target (const asw::Texture &texture)
 Set the render target to the window.
 
void reset_render_target ()
 Reset the render target to the default.
 
void clear ()
 Clear the window.
 
void clear (const asw::Color &color)
 Clear to colour.
 
void present ()
 Present the window.
 
void set_blend_mode (asw::BlendMode mode)
 Set the blend mode of a texture.
 

Variables

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

Function Documentation

◆ clear() [1/2]

void asw::display::clear ( )

Clear the window.

Definition at line 92 of file display.cpp.

◆ clear() [2/2]

void asw::display::clear ( const asw::Color & color)

Clear to colour.

Parameters
colorThe color to clear to.

Definition at line 101 of file display.cpp.

◆ get_logical_size()

asw::Vec2< int > asw::display::get_logical_size ( )

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 50 of file display.cpp.

◆ get_scale()

asw::Vec2< float > asw::display::get_scale ( )

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 62 of file display.cpp.

◆ get_size()

asw::Vec2< int > asw::display::get_size ( )

Get the size of the window.

Returns
The size of the window.

Definition at line 43 of file display.cpp.

◆ present()

void asw::display::present ( )

Present the window.

Definition at line 107 of file display.cpp.

◆ reset_render_target()

void asw::display::reset_render_target ( )

Reset the render target to the default.

Definition at line 83 of file display.cpp.

◆ set_blend_mode()

void asw::display::set_blend_mode ( asw::BlendMode mode)

Set the blend mode of a texture.

Parameters
textureThe texture to set the blend mode of.
modeThe blend mode to set.

Definition at line 116 of file display.cpp.

◆ set_fullscreen()

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

Set the window to fullscreen or windowed.

Parameters
fullscreenWhether or not to set the window to fullscreen.

Definition at line 28 of file display.cpp.

◆ set_icon()

void asw::display::set_icon ( 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 17 of file display.cpp.

◆ set_render_target()

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

Set the render target to the window.

Definition at line 74 of file display.cpp.

◆ set_resizable()

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

Set resizable flag of the window.

Parameters
resizableWhether or not the window is resizable.

Definition at line 38 of file display.cpp.

◆ set_resolution()

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

Set the resolution of the window.

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

Definition at line 33 of file display.cpp.

◆ set_title()

void asw::display::set_title ( 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.