OpenGL: when checking GL version, assume >= 2.1
authorMike Erwin <significant.bit@gmail.com>
Tue, 24 Nov 2015 07:34:54 +0000 (02:34 -0500)
committerMike Erwin <significant.bit@gmail.com>
Tue, 24 Nov 2015 07:34:54 +0000 (02:34 -0500)
Mostly glBlendFunc related.

intern/opencolorio/ocio_impl_glsl.cc
source/blender/editors/gpencil/drawgpencil.c
source/blender/editors/interface/interface_icons.c
source/blender/editors/space_view3d/drawvolume.c
source/blender/gpu/intern/gpu_draw.c

index de89ea72f3c215f4f042632e873e55da2974ef10..42bd20d2eb1653d5178353102b6bc03b0b6b4a8b 100644 (file)
@@ -221,8 +221,8 @@ static bool ensureCurveMappingAllocated(OCIO_GLSLDrawState *state, OCIO_CurveMap
 /* Detect if we can support GLSL drawing */
 bool OCIOImpl::supportGLSLDraw()
 {
-       /* GLSL and GL_RGB16F_ARB */
-       return GLEW_VERSION_2_0 && (GLEW_VERSION_3_0 || GLEW_ARB_texture_float);
+       /* uses GL_RGB16F_ARB */
+       return GLEW_VERSION_3_0 || GLEW_ARB_texture_float;
 }
 
 static bool supportGLSL13()
index 6b71c0ac053e767cc341b5f1817feb60041e2013..d17ed22b1ec0db4fa92ccba331ad6d8970229902 100644 (file)
@@ -1111,13 +1111,7 @@ static void gp_draw_data(bGPdata *gpd, int offsx, int offsy, int winx, int winy,
         */
        
        /* turn on alpha-blending */
-       if (GLEW_VERSION_1_4) {
-               glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
-       }
-       else {
-               glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-       }
-
+       glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
        glEnable(GL_BLEND);
        
        /* draw! */
index ed1137fee7325df18110aafdcf4b97fcd3212111..843b0d5f2dc43391b4c1a7952b3bb7a30b6bf627 100644 (file)
@@ -1228,12 +1228,7 @@ static void icon_draw_size(
                        if (!pi->rect[size]) return;  /* something has gone wrong! */
                        
                        /* preview images use premul alpha ... */
-                       if (GLEW_VERSION_1_4) {
-                               glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
-                       }
-                       else {
-                               glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-                       }
+                       glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
 
                        icon_draw_rect(x, y, w, h, aspect, pi->w[size], pi->h[size], pi->rect[size], alpha, rgb, is_preview);
                        glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
index a27037534f9d5b59fade2e3e99510a721abb986c..7f102bccff1bdf53812fafae37e3dbaaedc81197 100644 (file)
@@ -313,10 +313,7 @@ void draw_smoke_volume(SmokeDomainSettings *sds, Object *ob,
 
                        /* render fire slice */
                        if (use_fire) {
-                               if (GLEW_VERSION_1_4)
-                                       glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE, GL_ONE, GL_ONE);
-                               else
-                                       glBlendFunc(GL_SRC_ALPHA, GL_ONE);
+                               glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE, GL_ONE, GL_ONE);
 
                                GPU_program_parameter_4f(smoke_program, 2, 1.0, 0.0, 0.0, 0.0);
                                glBegin(GL_POLYGON);
@@ -332,10 +329,7 @@ void draw_smoke_volume(SmokeDomainSettings *sds, Object *ob,
                        }
 
                        /* render smoke slice */
-                       if (GLEW_VERSION_1_4)
-                               glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
-                       else
-                               glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+                       glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
 
                        GPU_program_parameter_4f(smoke_program, 2, -1.0, 0.0, 0.0, 0.0);
                        glBegin(GL_POLYGON);
index f71733064c4d88f87cd469b026fccfff66a238c9..aaf4037197ec3a6ba15929bef10465e15d98ad56 100644 (file)
@@ -438,10 +438,7 @@ static void gpu_set_alpha_blend(GPUBlendMode alphablend)
                glDisable(GL_SAMPLE_ALPHA_TO_COVERAGE);
 
                /* for OpenGL render we use the alpha channel, this makes alpha blend correct */
-               if (GLEW_VERSION_1_4)
-                       glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
-               else
-                       glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+               glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
                
                /* if U.glalphaclip == 1.0, some cards go bonkers...
                 * turn off alpha test in this case */