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
26void _init(int width, int height, int scale);
27
34void _init_opengl(int width, int height, int scale);
35
40void _shutdown();
41
47
53
58void set_title(const std::string& title);
59
65void set_icon(const std::string& path);
66
71void set_fullscreen(bool fullscreen);
72
78void set_resolution(int w, int h);
79
84void set_resizable(bool resizable);
85
91
98
105
108void set_render_target(const asw::Texture& texture);
109
113
116void clear();
117
122void clear(const asw::Color& color);
123
126void present();
127
134
140void warp_mouse(float x, float y);
141
144void swap_window();
145
146} // namespace asw::display
147
148#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:77
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:124
void set_fullscreen(bool fullscreen)
Set the window to fullscreen or windowed.
Definition display.cpp:89
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:112
void _init_opengl(int width, int height, int scale)
Initialize the display module with OpenGL support. Called by asw::core::init().
Definition display.cpp:29
void set_blend_mode(asw::BlendMode mode)
Set the blend mode of a texture.
Definition display.cpp:178
void reset_render_target()
Reset the render target to the default.
Definition display.cpp:145
asw::Vec2< int > get_size()
Get the size of the window.
Definition display.cpp:105
void swap_window()
Swap window (gl)
Definition display.cpp:188
void present()
Present the window.
Definition display.cpp:169
void set_render_target(const asw::Texture &texture)
Set the render target to the window.
Definition display.cpp:136
void clear()
Clear the window.
Definition display.cpp:154
void _shutdown()
Shut down the display module. Called by asw::core::shutdown(). Nulls the renderer and window pointers...
Definition display.cpp:47
void warp_mouse(float x, float y)
Warp mouse in window.
Definition display.cpp:183
asw::Renderer * get_renderer()
Get the SDL renderer.
Definition display.cpp:62
asw::Window * get_window()
Get the SDL window.
Definition display.cpp:67
void _init(int width, int height, int scale)
Initialize the display module. Called by asw::core::init().
Definition display.cpp:15
void set_title(const std::string &title)
Set the title of the window.
Definition display.cpp:72
void set_resolution(int w, int h)
Set the resolution of the window.
Definition display.cpp:95
void set_resizable(bool resizable)
Set resizable flag of the window.
Definition display.cpp:100
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.