$Date: 2005/10/26 03:47:00 $
$Revision: 1.18 $
-- Initialize scene.
-- This is called before the scene is shown on screen.
-- Uninitialize scene.
-- This is called right before next scene is displayed.
-- Redefine this to clean up some needed things (openGl properties, images, ...)
-- Event loop that makes scene running
-- Scene that should be executed after this scene ends.
-- If next_scene = Void the program just ends.
-- Surface where scene is drawed
-- Is scene currently running?
-- Otherwise no events are dispatched and no animation will run right now.
-- If a_value is True make frame counter visible,
-- else make it invisible.
-- we have to create next scene in same thread as the SDL thread
-- this function should point to a feature were next scene is created
-- Indicates that next scene is set and must be proceeded by
-- the main SDL Thread (syncronise both threads)
-- Set next_scene to a_scene from an other thread
-- Make sure that start_next_scene is called by the main SDL Thread
-- Stop scene whitout starting another one.
-- Run scene and show it on a_screen.
-- Stop Current and advance to next_scene.
-- Call creation procedure for next scene and start this scene immediadely
-- Redraw scene.
-- Animation event, allows animatable objects to perform animation
-- (i.e. moving them selves) before they get drawed.
-- As an argument the reference time in milliseconds is passed
-- up to which the animatable objects should draw them selves.
-- This event gets published right before the scene is redrawed.
-- Let all subscribed animatable objects perform their animation.
-- (Calls go_to_time of animatable objects with current time tick)
-- Subscribe an_animatable to be animated when Current is running.
-- Unsubscribe an_animatable from beeing animated when Current is running.
Base class for interactive scenes.
Descendants have to implement redraw and initialize_scene.
An EM_SCENE consists of:
- An event_loop that runs the scene and dispatches events to subscribers.
- A screen onto which the scene is drawn when running.
There are some handle_xxx features to handle important events for user interaction
that descendants can redefine to interact.
An EM_SCENE is supposed to be used as follows (i.e. by EM_APPLICATION):
- initialize_scene: called first to initialize the scene
- run: called after initialize_scene to run the scene
- other features: called by event_loop.dispatch
If you want that another scene is executed after your scene ends use set_next_scene
accordingly. Then call start_next_scene to start it.
If you want to end the program call quit.
Use animation features to get animatable objects (i.e. sprites) running.
Like this all animatable objects get animated before the scene is redrawn.
Subclasses must call make_scene at creation.