34 Popup_State operator=(
const Popup_State &);
45 if(m_gamestate.is_pausable()) {
60 if(m_gamestate.is_pausable()) {
80 if(!m_gamestate.is_pausable())
81 m_gamestate.perform_logic();
87 m_gamestate.prerender();
106 vr.
set_2d(get_virtual_window(), fix_aspect_ratio());
116 Popup_Menu_State operator=(
const Popup_Menu_State &);
118 class ZENI_REST_DLL Continue_Button :
public Text_Button {
119 Continue_Button(
const Continue_Button &);
120 Continue_Button operator=(
const Continue_Button &);
123 Continue_Button(
const Gamestate &gamestate)
125 "system_36_800x600",
"Continue Game"),
126 m_gamestate(gamestate)
138 class ZENI_REST_DLL Menu_Button :
public Text_Button {
139 Menu_Button(
const Menu_Button &);
140 Menu_Button operator=(
const Menu_Button &);
145 "system_36_800x600",
"Back to Menu")
159 Configure_Video_Button & operator=(
const Configure_Video_Button &);
163 :
Text_Button(upper_left, lower_right,
"system_36_800x600",
"Configure Video")
170 } configure_video_button;
175 Sound_Check_Box operator=(
const Sound_Check_Box &);
182 if(dynamic_cast<Sound_Renderer_NULL *>(&
get_Sound().get_Renderer())) {
198 const Point2f &ul = get_upper_left();
199 const Point2f &lr = get_lower_right();
200 Color bgc = cr[
"title_bg"];
204 const float tl = 0.2f * tw;
205 const float tr = 1.4f * tw;
214 const Color fgc = cr[
"default_button_bg_normal"];
230 Quit_Button & operator=(
const Quit_Button &);
234 :
Text_Button(upper_left, lower_right,
"system_36_800x600",
"Quit")
244 : continue_button(m_gamestate),
251 m_widgets.lend_Widget(continue_button);
253 m_widgets.lend_Widget(configure_video_button);
255 m_widgets.lend_Widget(sound_check_box);
256 m_widgets.lend_Widget(menu_button);
257 m_widgets.lend_Widget(quit_button);
264 m_widgets.unlend_Widget(menu_button);
269 m_widgets.lend_Widget(menu_button);
286 Popup_Pause_State operator=(
const Popup_Pause_State &);
293 #if SDL_VERSION_ATLEAST(2,0,0)
298 Gamestate_Base::on_window_event(event);
300 #elif !defined(ANDROID)
302 if(event.gain && (event.state & SDL_APPINPUTFOCUS))
311 if(m_gamestate.is_pausable())
317 if(m_gamestate.is_pausable()) {
325 m_gamestate.render();
334 return new Popup_Pause_State;
virtual float get_text_width(const String &text) const =0
Get the width of text rendering using this font. Approximately text_height * text.length() / 2.0f.
Controllers & get_Controllers()
Get access to the singleton.
void on_event(const SDL_Event &event)
void pause_all()
Pause all Sound_Sources.
An Abstraction of a Line.
virtual void on_accept()
Called when the cursor is released inside the button.
The Video Rendering Singleton.
Sound_Source_Pool & get_Sound_Source_Pool()
Get access to the singleton.
An Abstraction of a Vertex in 2-space, colored.
Colors & get_Colors()
Get access to the singleton.
void reset_vibration_all()
Set vibration for all controllers to <0,0>
virtual void clear_depth_buffer()=0
Can reset the depth buffer at any time if necessary.
Gamestate pop_state()
Pop a Gamestate off the stack. Pop the current Gamestate with caution. All members will instantly bec...
A Color database read in from a file.
Sound_Renderer & get_Renderer()
Get the current Sound_Renderer.
static void pause_all()
Pause all Chronometer<TIME> objects.
An Abstraction of a Quadrilateral.
Game & get_Game()
Get access to the singleton.
void unpause_all()
Unpause all paused Sound_Sources.
virtual void prerender()
No actual rendering, but any logic strictly necessary for rendering.
Sound & get_Sound()
Get access to the singleton.
Keyboard button event structure (event.key.*)
void set_screen_saver(const bool &enabled)
Enable/Disable the screen saver.
A smartpointer for a Gamestate_Base.
virtual void render(const Renderable &renderable)=0
Render a Renderable.
void push_state(const Gamestate &state)
Push a new Gamestate onto the stack.
void set_2d()
Set the default 2D view filling the entire display area.
DECLSPEC void SDLCALL SDL_Delay(Uint32 ms)
Wait a specified number of milliseconds before returning.
void set_listener_muted(const bool &muted)
Set whether the listener is muted.
A class to signal that the program is quitting.
Window state change event data (event.window.*)
EGLSurface EGLint EGLint y
virtual void on_active(const SDL_ActiveEvent &event)
Override this input callback in your Gamestates. See SDL documentation for details.
Core & get_Core()
Get access to the singleton.
Fonts & get_Fonts()
Get access to the singleton.
Video & get_Video()
Get access to the singleton.
float get_text_height() const
Get the height of the font. The width is usually half the height, by default.
A 2D Point represented with floats.
static void unpause_all()
Unpause all Chronometer<TIME> objects.
virtual void render_text(const String &text, const Point2f &position, const Color &color, const JUSTIFY &justify=ZENI_DEFAULT_JUSTIFY) const =0
Render text at screen position (x, y), with justification JUSTIFY.