Revision: 18836
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18836
Author:   blendix
Date:     2009-02-06 17:51:09 +0100 (Fri, 06 Feb 2009)

Log Message:
-----------
2.5: Enable triple buffer drawing by default (if it doesn't work
or flickers, kick me). Also removed proxy texture test since it
does not seem to be implemented well by all drivers.

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/makesdna/DNA_userdef_types.h
    branches/blender2.5/blender/source/blender/windowmanager/intern/wm_draw.c

Modified: 
branches/blender2.5/blender/source/blender/makesdna/DNA_userdef_types.h
===================================================================
--- branches/blender2.5/blender/source/blender/makesdna/DNA_userdef_types.h     
2009-02-06 16:40:14 UTC (rev 18835)
+++ branches/blender2.5/blender/source/blender/makesdna/DNA_userdef_types.h     
2009-02-06 16:51:09 UTC (rev 18836)
@@ -327,8 +327,8 @@
 #define USER_VRML_TWOSIDED             4
 
 /* wm draw method */
-#define USER_DRAW_OVERLAP              0
-#define USER_DRAW_TRIPLE               1
+#define USER_DRAW_TRIPLE               0
+#define USER_DRAW_OVERLAP              1
 #define USER_DRAW_FULL                 2
 
 /* tw_flag (transform widget) */

Modified: 
branches/blender2.5/blender/source/blender/windowmanager/intern/wm_draw.c
===================================================================
--- branches/blender2.5/blender/source/blender/windowmanager/intern/wm_draw.c   
2009-02-06 16:40:14 UTC (rev 18835)
+++ branches/blender2.5/blender/source/blender/windowmanager/intern/wm_draw.c   
2009-02-06 16:51:09 UTC (rev 18836)
@@ -365,7 +365,7 @@
 
 static int wm_triple_gen_textures(wmWindow *win, wmDrawTriple *triple)
 {
-       GLint width;
+       GLint maxsize;
        int x, y;
 
        /* compute texture sizes */
@@ -402,16 +402,13 @@
 
        for(y=0; y<triple->ny; y++) {
                for(x=0; x<triple->nx; x++) {
-                       /* disabled, does not seems to work well everywhere */
                        /* proxy texture is only guaranteed to test for the 
cases that
                         * there is only one texture in use, which may not be 
the case */
-                       glBindTexture(triple->target, triple->bind[x + 
y*triple->nx]);
-                       glTexImage2D(GL_PROXY_TEXTURE_2D, 0, GL_RGB8, 
triple->x[x], triple->y[y], 0, GL_RGB, GL_UNSIGNED_BYTE, NULL);
-                       glGetTexLevelParameteriv(GL_PROXY_TEXTURE_2D, 0, 
GL_TEXTURE_WIDTH, &width);
+                       glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxsize);
 
-                       if(width == 0) {
+                       if(triple->x[x] > maxsize || triple->y[y] > maxsize) {
                                glBindTexture(triple->target, 0);
-                               printf("WM: failed to allocate texture for 
triple buffer drawing (GL_PROXY_TEXTURE_2D).\n");
+                               printf("WM: failed to allocate texture for 
triple buffer drawing (texture too large for graphics card).\n");
                                return 0;
                        }
 


_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to