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 "./types.h"
15
16namespace asw::display {
17
19 extern asw::Renderer* renderer;
20
22 extern asw::Window* window;
23
28 void setTitle(const std::string& title);
29
35 void setIcon(const std::string& path);
36
41 void setFullscreen(bool fullscreen);
42
48 void setResolution(int w, int h);
49
54 void setResizable(bool resizable);
55
60 SDL_Point getSize();
61
67 SDL_Point getLogicalSize();
68
74 SDL_FPoint getScale();
75
78 void setRenderTarget(const asw::Texture& texture);
79
82 void resetRenderTarget();
83
86 void clear();
87
90 void present();
91
92} // namespace asw::display
93
94#endif // ASW_DISPLAY_H
void setRenderTarget(const asw::Texture &texture)
Set the render target to the window.
Definition display.cpp:57
void setIcon(const std::string &path)
Set the icon to display on the window. If it does not exist, this will silently fail.
Definition display.cpp:16
SDL_Point getSize()
Get the size of the window.
Definition display.cpp:38
void setResizable(bool resizable)
Set resizable flag of the window.
Definition display.cpp:34
void present()
Present the window.
Definition display.cpp:69
void clear()
Clear the window.
Definition display.cpp:65
SDL_Point getLogicalSize()
Get the logical size of the window. This may differ from the actual size if scaling is enabled.
Definition display.cpp:44
SDL_FPoint getScale()
Get the scale of the window. This is equivalent to the logical size divided by the actual size.
Definition display.cpp:51
void setResolution(int w, int h)
Set the resolution of the window.
Definition display.cpp:30
void resetRenderTarget()
Reset the render target to the default.
Definition display.cpp:61
void setFullscreen(bool fullscreen)
Set the window to fullscreen or windowed.
Definition display.cpp:26
asw::Renderer * renderer
The renderer for the display module.
Definition display.cpp:9
asw::Window * window
The window for the display module.
Definition display.cpp:10
void setTitle(const std::string &title)
Set the title of the window.
Definition display.cpp:12
std::shared_ptr< SDL_Texture > Texture
Alias for a shared pointer to an SDL_Texture.
Definition types.h:20
SDL_Window Window
Alias for a shared pointer to an SDL_Window.
Definition types.h:35
SDL_Renderer Renderer
Alias for a shared pointer to an SDL_Renderer.
Definition types.h:32
Types used throughout the ASW library.