Screen Class Reference

Abstract base class for code the MainLoop runs exclusively and full-screen. More...

#include <screen.hpp>

Inherited by GameSession, LevelIntro, TextScroller, TitleScreen, and worldmap::WorldMap.

List of all members.

Public Member Functions

virtual ~Screen ()
virtual void setup ()
 gets called before this screen gets activated (which is at least once before the first draw or update call
virtual void leave ()
 gets called when the current screen is temporarily suspended
virtual void draw (DrawingContext &context)=0
 gets called once per frame.
virtual void update (float elapsed_time)=0
 gets called for once (per logical) frame.


Detailed Description

Abstract base class for code the MainLoop runs exclusively and full-screen.

Examples of Screens are: The TitleScreen, a WorldMap, a level's GameSession, a TextScroller, ...

Definition at line 28 of file screen.hpp.


Constructor & Destructor Documentation

virtual Screen::~Screen (  )  [inline, virtual]

Definition at line 31 of file screen.hpp.

00032   {}


Member Function Documentation

virtual void Screen::setup (  )  [inline, virtual]

gets called before this screen gets activated (which is at least once before the first draw or update call

Reimplemented in GameSession, LevelIntro, TextScroller, TitleScreen, and worldmap::WorldMap.

Definition at line 38 of file screen.hpp.

Referenced by ScreenManager::handle_screen_switch().

00039   {}

virtual void Screen::leave (  )  [inline, virtual]

gets called when the current screen is temporarily suspended

Reimplemented in TitleScreen, and worldmap::WorldMap.

Definition at line 41 of file screen.hpp.

00042   {}

virtual void Screen::draw ( DrawingContext context  )  [pure virtual]

gets called once per frame.

The screen should draw itself in this function. State changes should not be done in this function, but rather in update

Implemented in GameSession, LevelIntro, TextScroller, TitleScreen, and worldmap::WorldMap.

virtual void Screen::update ( float  elapsed_time  )  [pure virtual]

gets called for once (per logical) frame.

Screens should do their state updates and logic here

Implemented in GameSession, LevelIntro, TextScroller, TitleScreen, and worldmap::WorldMap.


The documentation for this class was generated from the following file:
Generated on Mon Jun 9 03:38:34 2014 for SuperTux by  doxygen 1.5.1