* rearrange screen level drawing code a bit in preparation for tests.
authorNathan Letwory <nathan@letworyinteractive.com>
Wed, 16 Jan 2008 19:49:34 +0000 (19:49 +0000)
committerNathan Letwory <nathan@letworyinteractive.com>
Wed, 16 Jan 2008 19:49:34 +0000 (19:49 +0000)
source/blender/editors/include/BIF_glutil.h
source/blender/editors/screen/glutil.c
source/blender/editors/screen/screen_edit.c
source/blender/windowmanager/intern/wm_event_system.c

index fcc5b6377e8e68f1b6684cf78c5403efcd5fe358..bc622a94be5fb26486e5ffbb6570ca90a1696c5f 100644 (file)
  *
  * Contributor(s): Blender Foundation 2002-2008
  *
-<<<<<<< .mine
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
-=======
  * ***** END GPL LICENSE BLOCK *****
->>>>>>> .r13159
  */
 
 #ifndef BIF_GLUTIL_H
@@ -40,6 +34,8 @@ struct rctf;
 void fdrawline(float x1, float y1, float x2, float y2);
 void fdrawbox(float x1, float y1, float x2, float y2);
 void sdrawline(short x1, short y1, short x2, short y2);
+void sdrawtri(short x1, short y1, short x2, short y2);
+void sdrawtrifill(short x1, short y1, short x2, short y2, float r, float g, float b);
 void sdrawbox(short x1, short y1, short x2, short y2);
 
 void sdrawXORline(int x0, int y0, int x1, int y1);
index a601b301da60af76e38b764790824c4bc93fa05c..81ef883c6c7422856faa6c5d19c96a0255ff6e1e 100644 (file)
@@ -93,6 +93,42 @@ void sdrawline(short x1, short y1, short x2, short y2)
        glEnd();
 }
 
+/*
+
+       x1,y2
+       |  \
+       |   \
+       |    \
+       x1,y1-- x2,y1
+
+*/
+
+void sdrawtripoints(short x1, short y1, short x2, short y2){
+       short v[2];
+       v[0]= x1; v[1]= y1;
+       glVertex2sv(v);
+       v[0]= x1; v[1]= y2;
+       glVertex2sv(v);
+       v[0]= x2; v[1]= y1;
+       glVertex2sv(v);
+       glEnd();
+}
+
+void sdrawtri(short x1, short y1, short x2, short y2)
+{
+       glBegin(GL_LINE_STRIP);
+       sdrawtripoints(x1, y1, x2, y2);
+       glEnd();
+}
+
+void sdrawtrifill(short x1, short y1, short x2, short y2, float r, float g, float b)
+{
+       glBegin(GL_TRIANGLES);
+       glColor3f(r, g, b);
+       sdrawtripoints(x1, y1, x2, y2);
+       glEnd();
+}
+
 void sdrawbox(short x1, short y1, short x2, short y2)
 {
        short v[2];
index 9071cb78dac61e700a95b29fbf7a796bd1a009b2..fc15a14a97471385ef080cf8e5dc14507b07f511 100644 (file)
@@ -700,9 +700,13 @@ void screen_test_scale(bScreen *sc, int winsizex, int winsizey)
 static void drawscredge_area(ScrArea *sa)
 {
        short x1= sa->v1->vec.x;
+       short xa1= x1+HEADERY;
        short y1= sa->v1->vec.y;
+       short ya1= y1+HEADERY;
        short x2= sa->v3->vec.x;
+       short xb2= x2-HEADERY;
        short y2= sa->v3->vec.y;
+       short yb2= y2-HEADERY;
        
        cpack(0x0);
        
@@ -710,14 +714,19 @@ static void drawscredge_area(ScrArea *sa)
        sdrawline(x2, y1, x2, y2);
        
        /* left border area */
-       if(x1>0) { // otherwise it draws the emboss of window over
+       if(x1>0) { /* otherwise it draws the emboss of window over */
                sdrawline(x1, y1, x1, y2);
-       }       
+       }
+       
        /* top border area */
        sdrawline(x1, y2, x2, y2);
        
        /* bottom border area */
        sdrawline(x1, y1, x2, y1);
+       
+       /* temporary viz for 'action corner' */
+       sdrawtrifill(x1, y1, xa1, ya1, .2, .2, .2);
+       
 }
 
 void ED_screen_do_listen(bScreen *screen, wmNotifier *note)
index cfdc88164e3b73908eacf485aa638bea25749963..4e5388257a6cc78c6e43d74b0bab9267eff47384 100644 (file)
@@ -180,8 +180,6 @@ void wm_draw_update(bContext *C)
                        /* notifiers for screen redraw */
                        if(win->screen->do_refresh)
                                ED_screen_refresh(C->wm, win);
-                       if(win->screen->do_draw)
-                               ED_screen_draw(win);
                        
                        for(sa= win->screen->areabase.first; sa; sa= sa->next) {
                                ARegion *ar= sa->regionbase.first;
@@ -198,6 +196,11 @@ void wm_draw_update(bContext *C)
                                                ED_region_do_draw(C, ar);
                                }
                        }
+                       
+                       /* move this here so we can do area 'overlay' drawing */
+                       if(win->screen->do_draw)
+                               ED_screen_draw(win);
+                       
                        wm_window_swap_buffers(win);
                }
        }