comparison engine/core/controller/engine.cpp @ 635:3094988564d5

* Added a simple method to query the default video card capabilities. This is still a work in progress. You can now get a list of ScreenModes the device supports. ScreenMode includes information on the screen resolution, if the mode is fullscreen/windowed and if it would use the OpenGL or SDL renderer.
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Wed, 06 Oct 2010 19:19:08 +0000
parents 356634098bd9
children 855ad500f991
comparison
equal deleted inserted replaced
634:5f381fa34769 635:3094988564d5
46 #include "video/imagepool.h" 46 #include "video/imagepool.h"
47 #include "video/animationpool.h" 47 #include "video/animationpool.h"
48 #include "audio/soundclippool.h" 48 #include "audio/soundclippool.h"
49 #include "video/renderbackend.h" 49 #include "video/renderbackend.h"
50 #include "video/cursor.h" 50 #include "video/cursor.h"
51 #include "video/devicecaps.h"
51 #ifdef HAVE_OPENGL 52 #ifdef HAVE_OPENGL
52 #include "video/opengl/renderbackendopengl.h" 53 #include "video/opengl/renderbackendopengl.h"
53 #include "gui/base/opengl/opengl_gui_graphics.h" 54 #include "gui/base/opengl/opengl_gui_graphics.h"
54 #endif 55 #endif
55 #include "gui/base/sdl/sdl_gui_graphics.h" 56 #include "gui/base/sdl/sdl_gui_graphics.h"
122 123
123 EngineSettings& Engine::getSettings() { 124 EngineSettings& Engine::getSettings() {
124 return m_settings; 125 return m_settings;
125 } 126 }
126 127
128 DeviceCaps& Engine::getDeviceCaps() {
129 return m_devcaps;
130 }
131
127 void Engine::preInit() { 132 void Engine::preInit() {
128 m_logmanager = LogManager::instance(); 133 m_logmanager = LogManager::instance();
129 134
130 FL_LOG(_log, "================== Engine pre-init start ================="); 135 FL_LOG(_log, "================== Engine pre-init start =================");
131 m_timemanager = new TimeManager(); 136 m_timemanager = new TimeManager();
190 } 195 }
191 FL_LOG(_log, "Initializing render backend"); 196 FL_LOG(_log, "Initializing render backend");
192 m_renderbackend->setColorKeyEnabled(m_settings.isColorKeyEnabled()); 197 m_renderbackend->setColorKeyEnabled(m_settings.isColorKeyEnabled());
193 m_renderbackend->init(); 198 m_renderbackend->init();
194 199
200 FL_LOG(_log, "Querying device capabilities");
201 m_devcaps.fillDeviceCaps();
202
195 FL_LOG(_log, "Creating main screen"); 203 FL_LOG(_log, "Creating main screen");
196 m_renderbackend->createMainScreen( 204 m_renderbackend->createMainScreen(
197 m_settings.getScreenWidth(), 205 m_settings.getScreenWidth(),
198 m_settings.getScreenHeight(), 206 m_settings.getScreenHeight(),
199 static_cast<unsigned char>(m_settings.getBitsPerPixel()), 207 static_cast<unsigned char>(m_settings.getBitsPerPixel()),