The Battle for Wesnoth  1.19.0-dev
Classes | Namespaces | Enumerations | Functions
video.hpp File Reference
#include "exceptions.hpp"
#include "lua_jailbreak_exception.hpp"
#include "sdl/point.hpp"
#include "sdl/rect.hpp"
#include "sdl/texture.hpp"
#include <SDL2/SDL_render.h>
#include <vector>
Include dependency graph for video.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  video::error
 An error specifically indicating video subsystem problems. More...
 
class  video::quit
 Type that can be thrown as an exception to quit to desktop. More...
 

Namespaces

 video
 

Enumerations

enum class  video::fake { video::none , video::no_window , video::no_draw , video::hide_window }
 For describing the type of faked display, if any. More...
 

Functions

void video::init (fake fake_type=fake::none)
 Initialize the video subsystem. More...
 
void video::deinit ()
 Deinitialize the video subsystem. More...
 
void video::update_buffers (bool autoupdate=true)
 Update buffers to match current resolution and pixel scale settings. More...
 
bool video::headless ()
 The game is running headless. More...
 
bool video::testing ()
 The game is running unit tests. More...
 
bool video::has_window ()
 Whether the game has set up a window to render into. More...
 
bool video::is_fullscreen ()
 Whether we are currently in fullscreen mode. More...
 
void video::set_fullscreen (bool)
 Set the fullscreen state. More...
 
void video::toggle_fullscreen ()
 Toggle fullscreen mode. More...
 
bool video::set_resolution (const point &resolution)
 Set the window resolution. More...
 
point video::current_resolution ()
 The current window size in desktop coordinates. More...
 
std::vector< pointvideo::get_available_resolutions (bool include_current=false)
 Returns the list of available screen resolutions. More...
 
std::string video::current_driver ()
 The current video driver in use, or else "<not initialized>". More...
 
std::vector< std::string > video::enumerate_drivers ()
 A list of available video drivers. More...
 
int video::current_refresh_rate ()
 The refresh rate of the screen. More...
 
bool video::window_is_visible ()
 True iff the window is not hidden. More...
 
bool video::window_has_focus ()
 True iff the window has mouse or input focus. More...
 
bool video::window_has_mouse_focus ()
 True iff the window has mouse focus. More...
 
void video::set_window_title (const std::string &title)
 Sets the title of the main window. More...
 
void video::set_window_icon (surface &icon)
 Sets the icon of the main window. More...
 
rect video::game_canvas ()
 The game canvas area, in drawing coordinates. More...
 
point video::game_canvas_size ()
 The size of the game canvas, in drawing coordinates / game pixels. More...
 
point video::draw_size ()
 The size of the current render target in drawing coordinates. More...
 
rect video::draw_area ()
 The current drawable area. More...
 
point video::output_size ()
 Returns the size of the final render target. More...
 
rect video::output_area ()
 {0, 0, output_size().x, output_size().y} More...
 
point video::window_size ()
 Returns the size of the window in display units / screen coordinates. More...
 
rect video::input_area ()
 Returns the input area of the window, in display coordinates. More...
 
int video::get_pixel_scale ()
 Get the current active pixel scale multiplier. More...
 
rect video::to_output (const rect &draw_space_rect)
 Convert coordinates in draw space to coordinates in render space. More...
 
surface video::read_pixels (SDL_Rect *r=nullptr)
 Copy back a portion of the render target that is already drawn. More...
 
surface video::read_pixels_low_res (SDL_Rect *r=nullptr)
 The same as read_pixels, but returns a low-resolution surface suitable for use with the old drawing system. More...
 
void video::force_render_target (const texture &t)
 Set the render target, without any provided way of setting it back. More...
 
void video::clear_render_target ()
 Reset the render target to the main window / screen. More...
 
void video::reset_render_target ()
 Reset the render target to the primary render buffer. More...
 
texture video::get_render_target ()
 Get the current render target. More...
 
std::vector< std::pair< std::string, std::string > > video::renderer_report ()
 Provides diagnostic information about the current renderer for the build_info API. More...
 
std::pair< float, float > video::get_dpi ()
 Retrieves the current game screen DPI for the build_info API. More...
 
SDL_Renderer * video::get_renderer ()
 
SDL_Window * video::get_window ()