|
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++.
|
Functions | |
| void | _init (int width, int height, int scale) |
| Initialize the display module. Called by asw::core::init(). | |
| void | _init_opengl (int width, int height, int scale) |
| Initialize the display module with OpenGL support. Called by asw::core::init(). | |
| void | _shutdown () |
| Shut down the display module. Called by asw::core::shutdown(). Nulls the renderer and window pointers before destroying them, so any outstanding shared_ptr asset deleters see a null renderer and become no-ops. | |
| asw::Renderer * | get_renderer () |
| Get the SDL renderer. | |
| asw::Window * | get_window () |
| Get the SDL window. | |
| 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. | |
| void | warp_mouse (float x, float y) |
| Warp mouse in window. | |
| void | swap_window () |
| Swap window (gl) | |
| void asw::display::_init | ( | int | width, |
| int | height, | ||
| int | scale ) |
Initialize the display module. Called by asw::core::init().
| width | The logical width of the display. |
| height | The logical height of the display. |
| scale | The initial window scale factor. |
Definition at line 15 of file display.cpp.
| void asw::display::_init_opengl | ( | int | width, |
| int | height, | ||
| int | scale ) |
Initialize the display module with OpenGL support. Called by asw::core::init().
| width | The logical width of the display. |
| height | The logical height of the display. |
| scale | The initial window scale factor. |
Definition at line 29 of file display.cpp.
| void asw::display::_shutdown | ( | ) |
Shut down the display module. Called by asw::core::shutdown(). Nulls the renderer and window pointers before destroying them, so any outstanding shared_ptr asset deleters see a null renderer and become no-ops.
Definition at line 47 of file display.cpp.
| void asw::display::clear | ( | ) |
Clear the window.
Definition at line 154 of file display.cpp.
| void asw::display::clear | ( | const asw::Color & | color | ) |
| 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.
Definition at line 112 of file display.cpp.
| asw::Renderer * asw::display::get_renderer | ( | ) |
Get the SDL renderer.
Definition at line 62 of file display.cpp.
| 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.
Definition at line 124 of file display.cpp.
| asw::Vec2< int > asw::display::get_size | ( | ) |
Get the size of the window.
Definition at line 105 of file display.cpp.
| asw::Window * asw::display::get_window | ( | ) |
Get the SDL window.
Definition at line 67 of file display.cpp.
| void asw::display::present | ( | ) |
Present the window.
Definition at line 169 of file display.cpp.
| void asw::display::reset_render_target | ( | ) |
Reset the render target to the default.
Definition at line 145 of file display.cpp.
| void asw::display::set_blend_mode | ( | asw::BlendMode | mode | ) |
Set the blend mode of a texture.
| texture | The texture to set the blend mode of. |
| mode | The blend mode to set. |
Definition at line 178 of file display.cpp.
| void asw::display::set_fullscreen | ( | bool | fullscreen | ) |
Set the window to fullscreen or windowed.
| fullscreen | Whether or not to set the window to fullscreen. |
Definition at line 89 of file display.cpp.
| 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.
| path | A path to the icon to display. |
Definition at line 77 of file display.cpp.
| void asw::display::set_render_target | ( | const asw::Texture & | texture | ) |
Set the render target to the window.
Definition at line 136 of file display.cpp.
| void asw::display::set_resizable | ( | bool | resizable | ) |
Set resizable flag of the window.
| resizable | Whether or not the window is resizable. |
Definition at line 100 of file display.cpp.
| void asw::display::set_resolution | ( | int | w, |
| int | h ) |
Set the resolution of the window.
| w | The width of the window. |
| h | The height of the window. |
Definition at line 95 of file display.cpp.
| void asw::display::set_title | ( | const std::string & | title | ) |
Set the title of the window.
| title | The title to display at the top of the window. |
Definition at line 72 of file display.cpp.
| void asw::display::swap_window | ( | ) |
Swap window (gl)
Definition at line 188 of file display.cpp.
| void asw::display::warp_mouse | ( | float | x, |
| float | y ) |
Warp mouse in window.
| x | The x coordinate to warp to. |
| y | The y coordinate to warp to. |
Definition at line 183 of file display.cpp.