diff options
author | Nathan Letwory <nathan@letworyinteractive.com> | 2008-01-16 22:49:34 +0300 |
---|---|---|
committer | Nathan Letwory <nathan@letworyinteractive.com> | 2008-01-16 22:49:34 +0300 |
commit | 7e14c5d119470c066fd76325dced68486117d91a (patch) | |
tree | 2ba53140e6cae2e3fcd05cd27ae0bb7dbc569157 | |
parent | 3eca7d1d06c41d68e460dba31a0d1be774247e79 (diff) |
* rearrange screen level drawing code a bit in preparation for tests.
-rw-r--r-- | source/blender/editors/include/BIF_glutil.h | 8 | ||||
-rw-r--r-- | source/blender/editors/screen/glutil.c | 36 | ||||
-rw-r--r-- | source/blender/editors/screen/screen_edit.c | 13 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 7 |
4 files changed, 54 insertions, 10 deletions
diff --git a/source/blender/editors/include/BIF_glutil.h b/source/blender/editors/include/BIF_glutil.h index fcc5b6377e8..bc622a94be5 100644 --- a/source/blender/editors/include/BIF_glutil.h +++ b/source/blender/editors/include/BIF_glutil.h @@ -22,13 +22,7 @@ * * 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); diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c index a601b301da6..81ef883c6c7 100644 --- a/source/blender/editors/screen/glutil.c +++ b/source/blender/editors/screen/glutil.c @@ -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]; diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index 9071cb78dac..fc15a14a974 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -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) diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index cfdc88164e3..4e5388257a6 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -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); } } |