Esempio n. 1
0
 def _process_event(self, event):
     if event.name == 'Quit':
         #self._quit_flag = event.data
         
         # Send the Quit event to the FrameworkManager
         if event.data:
             FrameworkManager.get_instance().stop()
Esempio n. 2
0
    def __init__(self):
        # Load Configuration settings
        ConfigurationManager.load_configuration()

        #Start Logger
        method = Settings.get('LoggerSettings','method')
        filename = Settings.get('LoggerSettings','filename')
        to_console = Settings.get('LoggerSettings','log_to_console')
        Logger.Configure(method, filename, to_console)
        Logger.Log('Initialising Core Systems')
        
        # The order of initialisation in this function is extremely important
        # as it determines the order in which classes will receive events.
        # For instance it is important that input is processed
        
        # Start Event System so it can receive new listeners when the
        # classes below are initialised 
        self._event_manager = EventManager.get_instance()
        
        #Register Core Event Listener for detecting quit
        self._core_listener = CoreListener(False)
        
        # Initialise Time
        self._time = Time.get_instance()
        
        # Create a Scene
        self._scene = SceneManager.get_instance()
        self._scene.init()
        
        #Start Render System
        self._render_manager = RenderManager.get_instance()

        self._render_manager.init( Settings.get('DisplaySettings','resolution')[0],
                                   Settings.get('DisplaySettings','resolution')[1],
                                   Settings.get('DisplaySettings','window_title')
                                 )
        
        # Setup the framework callbacks
        self._framework = FrameworkManager.framework()
        self._framework.setup = self.setup
        self._framework.run_loop = self.update
        self._framework.on_draw = self._render_manager.draw
        self._framework.on_shutdown = self.shutdown
                
        # Setup Frame Start/End Events
        self._frame_start = FrameStarted()
        self._frame_end = FrameEnded()
        
        #Get the Texture Manager
        self._texture_manager = TextureManager.get_instance()
        
        # Start the ShaderManager
        self._shader_manager = ShaderManager.get_instance()
        
        # Start Scripting System
        self._script_manager = ScriptManager.get_instance()
        
        # Start the UI Manager and setup the MainUI
        self._ui_manager = UIManager.get_instance()
        self._main_ui = MainUI()
        
        # Start the GizmoManager system
        self._gizmo_manager = GizmoManager.get_instance()
        
        # Configure the ResourceManager
        self._resource_manager = ResourceManager.get_instance()
        # enable Image Loading
        self._resource_manager.add_handler(ImageResourceHandler())
        # enable Scene Loading
        self._resource_manager.add_handler(SceneResourceHandler())
        # enable Wavefront Obj Loading
        self._resource_manager.add_handler(WavefrontResourceHandler())
Esempio n. 3
0
	def __init__(self):
		self._width = 800
		self._height = 600
		self._title = "Epsilon Engine"
		
		self._framework = FrameworkManager.framework()