24 #include <SDL2/SDL_render.h>
342 std::pair<float, float>
get_dpi();
Base class for exceptions that want to be thrown 'through' lua.
void store() const noexcept
Stores a copy the current exception to be rethrown.
Wrapper class to encapsulate creation and management of an SDL_Texture.
Type that can be thrown as an exception to quit to desktop.
#define IMPLEMENT_LUA_JAILBREAK_EXCEPTION(type)
Helper macro for classes deriving from lua_jailbreak_exception.
bool window_has_mouse_focus()
True iff the window has mouse focus.
bool headless()
The game is running headless.
rect draw_area()
The current drawable area.
rect output_area()
{0, 0, output_size().x, output_size().y}
void set_window_title(const std::string &title)
Sets the title of the main window.
void clear_render_target()
Reset the render target to the main window / screen.
rect to_output(const rect &r)
Convert coordinates in draw space to coordinates in render space.
std::vector< std::pair< std::string, std::string > > renderer_report()
Provides diagnostic information about the current renderer for the build_info API.
void reset_render_target()
Reset the render target to the primary render buffer.
point output_size()
Returns the size of the final render target.
std::vector< point > get_available_resolutions(const bool include_current)
Returns the list of available screen resolutions.
void set_window_icon(surface &icon)
Sets the icon of the main window.
bool window_is_visible()
True iff the window is not hidden.
surface read_pixels_low_res(SDL_Rect *r)
The same as read_pixels, but returns a low-resolution surface suitable for use with the old drawing s...
surface read_pixels(SDL_Rect *r)
Copy back a portion of the render target that is already drawn.
void force_render_target(const texture &t)
Set the render target, without any provided way of setting it back.
point game_canvas_size()
The size of the game canvas, in drawing coordinates / game pixels.
SDL_Window * get_window()
bool window_has_focus()
True iff the window has mouse or input focus.
point window_size()
Returns the size of the window in display units / screen coordinates.
bool has_window()
Whether the game has set up a window to render into.
bool testing()
The game is running unit tests.
bool is_fullscreen()
Whether we are currently in fullscreen mode.
std::vector< std::string > enumerate_drivers()
A list of available video drivers.
rect game_canvas()
The game canvas area, in drawing coordinates.
std::pair< float, float > get_dpi()
Retrieves the current game screen DPI for the build_info API.
int get_pixel_scale()
Get the current active pixel scale multiplier.
point current_resolution()
The current window size in desktop coordinates.
void init(fake type)
Initialize the video subsystem.
void set_fullscreen(bool fullscreen)
Set the fullscreen state.
void deinit()
Deinitialize the video subsystem.
bool set_resolution(const point &resolution)
Set the window resolution.
int current_refresh_rate()
The refresh rate of the screen.
std::string current_driver()
The current video driver in use, or else "<not initialized>".
void toggle_fullscreen()
Toggle fullscreen mode.
SDL_Renderer * get_renderer()
void update_buffers(bool autoupdate)
Update buffers to match current resolution and pixel scale settings.
texture get_render_target()
Get the current render target.
fake
For describing the type of faked display, if any.
point draw_size()
The size of the current render target in drawing coordinates.
rect input_area()
Returns the input area of the window, in display coordinates.
static void msg(const char *act, debug_info &i, const char *to="", const char *result="")
Contains the SDL_Rect helper code.
Base class for all the errors encountered by the engine.
An abstract description of a rectangle with integer coordinates.
An error specifically indicating video subsystem problems.
error(const std::string &msg)