diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-02-19 11:48:54 +0200 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-02-19 11:48:54 +0200 |
commit | f5ff378dd02431cdcf658b210509b170ea2135d1 (patch) | |
tree | fce642594b88a289e1b61564ad54759be7444075 /src | |
parent | 4c2b9ed516e3109d5c74a37c9479a516beae4f50 (diff) | |
download | minetest-f5ff378dd02431cdcf658b210509b170ea2135d1.tar.gz minetest-f5ff378dd02431cdcf658b210509b170ea2135d1.tar.bz2 minetest-f5ff378dd02431cdcf658b210509b170ea2135d1.zip |
video backend selection
Diffstat (limited to 'src')
-rw-r--r-- | src/defaultsettings.cpp | 1 | ||||
-rw-r--r-- | src/main.cpp | 39 |
2 files changed, 26 insertions, 14 deletions
diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index 72f63d9fb..a456a4fce 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -44,6 +44,7 @@ void set_default_settings() g_settings.setDefault("frametime_graph", "false"); g_settings.setDefault("enable_texture_atlas", "true"); g_settings.setDefault("texture_path", ""); + g_settings.setDefault("video_driver", "opengl"); g_settings.setDefault("free_move", "false"); g_settings.setDefault("continuous_forward", "false"); diff --git a/src/main.cpp b/src/main.cpp index 11ae9985c..2754c324b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1723,30 +1723,41 @@ int main(int argc, char *argv[]) std::string playername = g_settings.get("name");
- /*
- Resolution selection
- */
+ // Resolution selection
bool fullscreen = false;
u16 screenW = g_settings.getU16("screenW");
u16 screenH = g_settings.getU16("screenH");
- //
-
- MyEventReceiver receiver;
+ // Determine driver
video::E_DRIVER_TYPE driverType;
-
-#ifdef _WIN32
- //driverType = video::EDT_DIRECT3D9;
- driverType = video::EDT_OPENGL;
-#else
- driverType = video::EDT_OPENGL;
- //driverType = video::EDT_BURNINGSVIDEO; // Best software renderer
-#endif
+
+ std::string driverstring = g_settings.get("video_driver");
+
+ if(driverstring == "null")
+ driverType = video::EDT_NULL;
+ else if(driverstring == "software")
+ driverType = video::EDT_SOFTWARE;
+ else if(driverstring == "burningsvideo")
+ driverType = video::EDT_BURNINGSVIDEO;
+ else if(driverstring == "direct3d8")
+ driverType = video::EDT_DIRECT3D8;
+ else if(driverstring == "direct3d9")
+ driverType = video::EDT_DIRECT3D9;
+ else if(driverstring == "opengl")
+ driverType = video::EDT_OPENGL;
+ else
+ {
+ dstream<<"WARNING: Invalid video_driver specified; defaulting "
+ "to opengl"<<std::endl;
+ driverType = video::EDT_OPENGL;
+ }
// create device and exit if creation failed
+ MyEventReceiver receiver;
+
IrrlichtDevice *device;
device = createDevice(driverType,
core::dimension2d<u32>(screenW, screenH),
|