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
display.h
Go to the documentation of this file.
1
8
9#ifndef ASW_DISPLAY_H
10#define ASW_DISPLAY_H
11
12#include <string>
13
14#include "./color.h"
15#include "./geometry.h"
16#include "./types.h"
17
18namespace asw::display {
19
22
24extern asw::Window* window;
25
30void set_title(const std::string& title);
31
37void set_icon(const std::string& path);
38
43void set_fullscreen(bool fullscreen);
44
50void set_resolution(int w, int h);
51
56void set_resizable(bool resizable);
57
63
70
77
80void set_render_target(const asw::Texture& texture);
81
85
88void clear();
89
94void clear(const asw::Color& color);
95
98void present();
99
106
107} // namespace asw::display
108
109#endif // ASW_DISPLAY_H
A 2D vector in space.
Definition geometry.h:21
Common geometry types.
void set_icon(const std::string &path)
Set the icon to display on the window. If it does not exist, this will silently fail.
Definition display.cpp:17
asw::Vec2< float > get_scale()
Get the scale of the window. This is equivalent to the logical size divided by the actual size.
Definition display.cpp:62
void set_fullscreen(bool fullscreen)
Set the window to fullscreen or windowed.
Definition display.cpp:28
asw::Vec2< int > get_logical_size()
Get the logical size of the window. This may differ from the actual size if scaling is enabled.
Definition display.cpp:50
void set_blend_mode(asw::BlendMode mode)
Set the blend mode of a texture.
Definition display.cpp:116
void reset_render_target()
Reset the render target to the default.
Definition display.cpp:83
asw::Vec2< int > get_size()
Get the size of the window.
Definition display.cpp:43
void present()
Present the window.
Definition display.cpp:107
void set_render_target(const asw::Texture &texture)
Set the render target to the window.
Definition display.cpp:74
void clear()
Clear the window.
Definition display.cpp:92
asw::Renderer * renderer
The renderer for the display module.
Definition display.cpp:9
void set_title(const std::string &title)
Set the title of the window.
Definition display.cpp:12
void set_resolution(int w, int h)
Set the resolution of the window.
Definition display.cpp:33
asw::Window * window
The window for the display module.
Definition display.cpp:10
void set_resizable(bool resizable)
Set resizable flag of the window.
Definition display.cpp:38
std::shared_ptr< SDL_Texture > Texture
Alias for a shared pointer to an SDL_Texture.
Definition types.h:38
BlendMode
Mappings from SDL_BLENDMODE to ASW BlendMode.
Definition types.h:20
SDL_Window Window
Alias for a shared pointer to an SDL_Window.
Definition types.h:53
SDL_Renderer Renderer
Alias for a shared pointer to an SDL_Renderer.
Definition types.h:50
RGBA color struct with 8-bit channels.
Definition color.h:11
Types used throughout the ASW library.