58 void make_test_fake(
const unsigned width = 1024,
const unsigned height = 768);
65 bool non_interactive()
const;
87 void set_fullscreen(
bool ison);
89 void toggle_fullscreen();
91 bool is_fullscreen()
const;
93 bool set_resolution(
const unsigned width,
const unsigned height);
104 point current_resolution();
107 std::vector<point> get_available_resolutions(
const bool include_current =
false);
115 SDL_Rect screen_area(
bool as_pixels =
true)
const;
118 int get_width(
bool as_pixels =
true)
const;
121 int get_height(
bool as_pixels =
true)
const;
124 std::pair<float, float> get_dpi_scale_factor()
const;
131 bool window_has_flags(uint32_t flags)
const;
138 void set_window_title(
const std::string& title);
145 void set_window_icon(
surface& icon);
149 return refresh_rate_;
165 void blit_surface(
int x,
int y,
surface surf, SDL_Rect* srcrect =
nullptr, SDL_Rect* clip_rect =
nullptr);
174 void update_framebuffer();
189 void lock_updates(
bool value);
192 bool update_locked()
const;
194 void lock_flips(
bool);
206 int set_help_string(
const std::string& str);
209 void clear_help_string(
int handle);
212 void clear_all_help_strings();
217 static void delay(
unsigned int milliseconds);
222 :
game::
error(
"Video initialization failed")
260 virtual void handle_window_event(
const SDL_Event& event);
286 video.lock_updates(
true);
298 video.lock_updates(
false);
314 video_.lock_flips(
true);
319 video_.lock_flips(
false);
#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 &)
update_locker(CVideo &v, bool lock=true)
std::shared_ptr< halo_record > handle
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.