22 Widget_Gamestate::Widget_Gamestate(
const std::pair<Point2f, Point2f> &virtual_window_,
const bool &fix_aspect_ratio_)
23 : m_virtual_window(virtual_window_),
24 m_fix_aspect_ratio(fix_aspect_ratio_)
29 return m_virtual_window;
33 return m_fix_aspect_ratio;
69 #if SDL_VERSION_ATLEAST(2,0,0)
78 m_projector =
Projector2D(m_virtual_window, m_viewport);
86 vr.
set_2d(m_virtual_window, m_fix_aspect_ratio);
Mouse_State get_mouse_state() const
Find out if the mouse cursor is grabbed/hidden/relative.
const Color & get_clear_Color() const
Get the blank background color.
The Video Rendering Singleton.
virtual void set_clear_Color(const Color &color)=0
Set the blank background color.
void set_mouse_state(const Mouse_State &mouse_state)
Game & get_Game()
Get access to the singleton.
virtual void on_key(const SDL_KeyboardEvent &event)
Override this input callback in your Gamestates. See SDL documentation for details.
Keyboard button event structure (event.key.*)
struct Zeni::Game::Controller_Mouse controller_mouse
void set_2d()
Set the default 2D view filling the entire display area.
Mouse wheel event structure (event.wheel.*)
Window & get_Window()
Get access to the singleton.
std::pair< Point2i, Point2i > calculate_viewport(const std::pair< Point2f, Point2f > &camera2d, const std::pair< Point2i, Point2i > &viewport, const bool &fix_aspect_ratio)
Calculate the viewport.
Mouse motion event structure (event.motion.*)
Video & get_Video()
Get access to the singleton.
The Window Management Singleton.
A 2D Point represented with integers.