video backend selection
authorPerttu Ahola <celeron55@gmail.com>
Sat, 19 Feb 2011 09:48:54 +0000 (11:48 +0200)
committerPerttu Ahola <celeron55@gmail.com>
Sat, 19 Feb 2011 09:48:54 +0000 (11:48 +0200)
minetest.conf.example
src/defaultsettings.cpp
src/main.cpp

index edf43e889c4139f3614f231ea9c91383cca0f290..eb17ebc741a72c1aca585359c7721138ba45e8e8 100644 (file)
@@ -7,7 +7,9 @@
 # By default, all the settings are commented and not functional.
 # Uncomment settings by removing the preceding #.
 
+#
 # Client side stuff
+#
 
 #wanted_fps = 30
 #fps_max = 60
 #address = kray.dy.fi
 #name = 
 
-#random_input = false
-#client_delete_unused_sectors_timeout = 1200
-
+# Whether to try to fog out the border of the visible area
 #enable_fog = true
+# Enable a bit lower water surface; disable for speed
 #new_style_water = true
+# Enable nice leaves; disable for speed
 #new_style_leaves = true
+# Whether to draw a frametime graph
 #frametime_graph = false
+# Enable combining mainly used textures to a bigger one
 #enable_texture_atlas = true
+# Path to texture directory
 #texture_path =
+# Possible values: null, software, burningsvideo, direct3d8, direct3d9, opengl
+#video_driver = opengl
 
+# 
+#random_input = false
+#client_delete_unused_sectors_timeout = 1200
+
+#
 # Server side stuff
+#
 
 #map-dir = /home/palle/custom_map
 
index 72f63d9fb64e55e84789053790c5191057b90be6..a456a4fceee1a7bc4a1471b927d6e6ae92cd8bb2 100644 (file)
@@ -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");
index 11ae9985c54a9e9e5a137a51c9f5abb000f54a9f..2754c324b930cf7fe36644d036e45f3684bc30fc 100644 (file)
@@ -1723,30 +1723,41 @@ int main(int argc, char *argv[])
        \r
        std::string playername = g_settings.get("name");\r
 \r
-       /*\r
-               Resolution selection\r
-       */\r
+       // Resolution selection\r
        \r
        bool fullscreen = false;\r
        u16 screenW = g_settings.getU16("screenW");\r
        u16 screenH = g_settings.getU16("screenH");\r
 \r
-       //\r
-\r
-       MyEventReceiver receiver;\r
+       // Determine driver\r
 \r
        video::E_DRIVER_TYPE driverType;\r
-\r
-#ifdef _WIN32\r
-       //driverType = video::EDT_DIRECT3D9;\r
-       driverType = video::EDT_OPENGL;\r
-#else\r
-       driverType = video::EDT_OPENGL;\r
-       //driverType = video::EDT_BURNINGSVIDEO; // Best software renderer\r
-#endif\r
+       \r
+       std::string driverstring = g_settings.get("video_driver");\r
+\r
+       if(driverstring == "null")\r
+               driverType = video::EDT_NULL;\r
+       else if(driverstring == "software")\r
+               driverType = video::EDT_SOFTWARE;\r
+       else if(driverstring == "burningsvideo")\r
+               driverType = video::EDT_BURNINGSVIDEO;\r
+       else if(driverstring == "direct3d8")\r
+               driverType = video::EDT_DIRECT3D8;\r
+       else if(driverstring == "direct3d9")\r
+               driverType = video::EDT_DIRECT3D9;\r
+       else if(driverstring == "opengl")\r
+               driverType = video::EDT_OPENGL;\r
+       else\r
+       {\r
+               dstream<<"WARNING: Invalid video_driver specified; defaulting "\r
+                               "to opengl"<<std::endl;\r
+               driverType = video::EDT_OPENGL;\r
+       }\r
 \r
        // create device and exit if creation failed\r
 \r
+       MyEventReceiver receiver;\r
+\r
        IrrlichtDevice *device;\r
        device = createDevice(driverType,\r
                        core::dimension2d<u32>(screenW, screenH),\r