indexing description: "[ EiffelMedia HELLO_WORLD application. Displays an image. ]" date: "$Date$" revision: "$Revision$" class HELLO_WORLD inherit EM_APPLICATION EM_SHARED_BITMAP_FACTORY export {NONE} all end EM_SHARED_ERROR_HANDLER export {NONE} all end create make feature {NONE} -- Initialization make is -- Create the main application. local -- first_scene: EM_DRAWABLE_SCENE do -- set em_application properties set_window_height (274) set_window_width (283) set_screen_resolution (32) initialize_screen -- Check subsystem initialisation if Video_subsystem.is_enabled then -- Set global options set_window_icon ("icon.png") set_window_title ("EiffelMedia hello_world") set_application_id ("hello_world") -- Setup first scene create first_scene.make_scene Bitmap_factory.create_bitmap_from_image (image_file_name) image := Bitmap_factory.last_bitmap --image.set_transparent_color (0, 255, 0) first_scene.main_container.extend (image) -- Setup keyhandling first_scene.event_loop.key_down_event.subscribe (agent handle_key_down_event (?)) -- Set first scene and launch it set_scene (first_scene) launch -- Disable subsystems Video_subsystem.disable else io.error.put_string ("Failed to initialise video subsystem.%N") end end feature {NONE} -- Events Handle handle_key_down_event (an_event: EM_KEYBOARD_EVENT) is -- subscribe this handler to the event_loop of your scene, better -- define new scene and redefine its handler features do if an_event.key = an_event.sdlk_escape then first_scene.event_loop.stop end end feature {NONE} -- Implementation first_scene: EM_DRAWABLE_SCENE image: EM_BITMAP -- Image bitmap image_file_name: STRING is "hello_world.gif" -- Name of image we want to display end