comment regarding bug [#27175] UV faces show incorrect image in object mode (VBO's)
authorCampbell Barton <ideasman42@gmail.com>
Wed, 27 Apr 2011 05:12:07 +0000 (05:12 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 27 Apr 2011 05:12:07 +0000 (05:12 +0000)
source/blender/blenkernel/intern/cdderivedmesh.c

index 24b677cc240059259345ca567cf13acefbecf8c3..8bd650b1a423e25a41f293ffb348b72b710d4fc9 100644 (file)
@@ -770,6 +770,19 @@ static void cdDM_drawFacesTex_common(DerivedMesh *dm,
                }
 
                if( !GPU_buffer_legacy(dm) ) {
+                       /* warning!, this logic is incorrect, see bug [#27175]
+                        * firstly, there are no checks for changes in context, such as texface image.
+                        * secondly, drawParams() sets the GL context, so checking if there is a change
+                        * from lastFlag is too late once glDrawArrays() runs, since drawing the arrays
+                        * will use the modified, OpenGL settings.
+                        * 
+                        * However its tricky to fix this without duplicating the internal logic
+                        * of drawParams(), perhaps we need an argument like...
+                        * drawParams(..., keep_gl_state_but_return_when_changed) ?.
+                        *
+                        * We could also just disable VBO's here, since texface may be deprecated - campbell.
+                        */
+                       
                        glShadeModel( GL_SMOOTH );
                        lastFlag = 0;
                        for(i = 0; i < dm->drawObject->nelements/3; i++) {