22 #include <SDL2/SDL_render.h> 49 return singleton_ !=
nullptr;
67 void make_test_fake(
const unsigned width = 1024,
const unsigned height = 768);
74 bool non_interactive()
const;
85 SDL_Renderer* get_renderer();
89 return get_window() !=
nullptr;
108 void set_fullscreen(
bool ison);
110 void toggle_fullscreen();
112 bool is_fullscreen()
const;
114 bool supports_vsync()
const;
116 bool set_resolution(
const unsigned width,
const unsigned height);
127 point current_resolution();
133 void update_buffers();
136 std::vector<point> get_available_resolutions(
const bool include_current =
false);
142 SDL_Point output_size()
const;
149 SDL_Point window_size()
const;
155 SDL_Rect draw_area()
const;
162 SDL_Rect input_area()
const;
169 int get_width()
const;
176 int get_height()
const;
179 std::pair<float, float> get_dpi()
const;
182 std::pair<float, float> get_dpi_scale_factor()
const;
189 bool window_has_flags(uint32_t flags)
const;
196 void set_window_title(
const std::string& title);
203 void set_window_icon(
surface& icon);
207 return refresh_rate_;
223 void blit_surface(
int x,
int y,
surface surf, SDL_Rect* srcrect =
nullptr, SDL_Rect* clip_rect =
nullptr);
226 void render_screen();
232 void update_framebuffer();
247 void lock_updates(
bool value);
250 bool update_locked()
const;
252 void lock_flips(
bool);
264 int set_help_string(
const std::string& str);
267 void clear_help_string(
int handle);
270 void clear_all_help_strings();
275 static void delay(
unsigned int milliseconds);
280 :
game::
error(
"Video initialization failed")
321 virtual void handle_window_event(
const SDL_Event& event);
347 video.lock_updates(
true);
359 video.lock_updates(
false);
375 video_.lock_flips(
true);
380 video_.lock_flips(
false);
SDL_Texture * drawing_texture_
The drawing texture.
std::string current_driver()
#define IMPLEMENT_LUA_JAILBREAK_EXCEPTION(type)
Helper macro for classes deriving from lua_jailbreak_exception.
int help_string_
Curent ID of the help string.
static CVideo * singleton_
Type that can be thrown as an exception to quit to desktop.
static CVideo & get_singleton()
void blit_surface(const surface &surf, const SDL_Rect *srcrect, surface &dst, const SDL_Rect *dstrect)
Replacement for sdl_blit.
std::size_t size(const std::string &str)
Length in characters of a UTF-8 string.
The wrapper class for the SDL_Window class.
An object which will lock the display for the duration of its lifetime.
flip_locker(CVideo &video)
int current_refresh_rate() const
Base class for all the errors encountered by the engine.
void trigger_full_redraw()
video_event_handler event_handler_
virtual void handle_event(const SDL_Event &)
std::vector< std::string > enumerate_drivers()
update_locker(CVideo &v, bool lock=true)
std::shared_ptr< halo_record > handle
static bool setup_completed()
Base class for exceptions that want to be thrown 'through' lua.
std::unique_ptr< sdl::window > window
The SDL window object.
Helper class to manage SDL events.