indexing description: "[ APPLICATION is the root class of XAE. When the application is started, exactly one object of class APPLICATION will be instantiated using the creation procedure make. This class is part of the XAE Extended Adventure Engine Project. ]" author: "Ralph Wiedemeier, ralphw@student.ethz.ch" date: "$Date$" revision: "$Revision$" class APPLICATION inherit EM_APPLICATION redefine initialize_video_subsystem end GUI_SHARED create make feature {NONE} -- Initialization make is -- Create the main application. do -- Initialize ESDL video subsystem and screen -- (initialize_screen calls initialize_video_subsystem) initialize_screen -- Set application name and icon set_window_icon ("icon.png") set_window_title ("XAE Adventure Engine") set_application_id ("xae adventure engine") -- Create game engine engine := create {ENGINE}.make -- Create parser parser := create {GAME_PARSER}.make_parser -- Create serializer serializer := create {SERIALIZER}.make (engine) -- Start the graphical user interface gui.set_application (Current) gui.set_screen (screen) gui.set_parser (parser) gui.set_engine (engine) gui.set_serializer (serializer) gui.start end feature -- Global error handling throw_unrecoverable_exception (a_message: STRING) is -- Throw an unrecoverable exception: Display error -- message and exit application require valid_message: a_message /= Void do if exception_action /= Void then exception_action.call ([a_message]) else print ("Unrecoverable error:%N" + a_message) end end register_exception_action (an_action: PROCEDURE [ANY, TUPLE]) is -- Register a gui dialog routine which can display -- the error message to the user do exception_action := an_action end feature {NONE} -- Implementation initialize_video_subsystem is -- Initialize the ESDL video subsystem do video_subsystem.set_video_surface_width (width) video_subsystem.set_video_surface_height (height) video_subsystem.set_video_bpp (resolution) video_subsystem.set_doublebuffered (True) video_subsystem.set_hardware_surface (True) video_subsystem.set_fullscreen (fullscreen) video_subsystem.set_opengl (true) end engine: ENGINE_INTERFACE parser: PARSER_INTERFACE serializer: SERIALIZER exception_action: PROCEDURE [ANY, TUPLE] width: INTEGER is 1024 height: INTEGER is 768 resolution: INTEGER is 24 -- Size and color depth of the main window fullscreen: BOOLEAN is false -- Should the application be presented in fullscreen -- or in windowed mode? end -- class APPLICATION