Added a -noglsl option to disable GLSL from the command line.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Sun, 12 Oct 2008 18:32:26 +0000 (18:32 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Sun, 12 Oct 2008 18:32:26 +0000 (18:32 +0000)
source/blender/gpu/GPU_extensions.h
source/blender/gpu/intern/gpu_extensions.c
source/creator/creator.c

index 3813fe3da8ec8cb25fc5d002230ebb561ef1e5f4..66b1944941927919a4493ebe14ca83b8bb1ef96c 100644 (file)
@@ -51,6 +51,7 @@ typedef struct GPUFrameBuffer GPUFrameBuffer;
 struct GPUShader;
 typedef struct GPUShader GPUShader;
 
+void GPU_extensions_disable(void);
 void GPU_extensions_init(void); /* call this before running any of the functions below */
 void GPU_extensions_exit(void);
 int GPU_extensions_minimum_support(void);
index a8dc369460cd656c1d1270116d832c046decb9ff..7654c67419bf29f26591dad685904bce8f94fc0c 100644 (file)
        - arb draw buffers? 2.0 core
 */
 
-struct GPUGlobal {
+static struct GPUGlobal {
        GLint maxtextures;
        GLuint currentfb;
        int minimumsupport;
-} GG = {1, 0, 0};
+       int extdisabled;
+} GG = {1, 0, 0, 0};
+
+void GPU_extensions_disable()
+{
+       GG.extdisabled = 1;
+}
 
 void GPU_extensions_init()
 {
@@ -89,7 +95,7 @@ void GPU_extensions_init()
 
 int GPU_extensions_minimum_support()
 {
-       return GG.minimumsupport;
+       return !GG.extdisabled && GG.minimumsupport;
 }
 
 int GPU_print_error(char *str)
index ab86c46dbdddc05b9d8044a1312283fbfce2fbc7..38c37575bd1a5e216354e733db92a000232752b2 100644 (file)
@@ -77,6 +77,7 @@
 #include "RE_pipeline.h"
 
 #include "GPU_draw.h"
+#include "GPU_extensions.h"
 
 #include "playanim_ext.h"
 #include "mydevice.h"
@@ -220,6 +221,7 @@ static void print_help(void)
        printf ("  -d\t\tTurn debugging on\n");
        printf ("  -noaudio\tDisable audio on systems that support audio\n");
        printf ("  -nojoystick\tDisable joystick support\n");
+       printf ("  -noglsl\tDisable GLSL shading\n");
        printf ("  -h\t\tPrint this help text\n");
        printf ("  -y\t\tDisable automatic python script execution (scriptlinks, pydrivers, pyconstraints, pynodes)\n");
        printf ("  -P <filename>\tRun the given Python script (filename or Blender Text)\n");
@@ -506,6 +508,8 @@ int main(int argc, char **argv)
                                                SYS_WriteCommandLineInt(syshandle,"nojoystick",1);
                                                if (G.f & G_DEBUG) printf("disabling nojoystick\n");
                                        }
+                                       if (BLI_strcasecmp(argv[a], "-noglsl") == 0)
+                                               GPU_extensions_disable();
                                        break;
                                }
                        }