* rearrange screen level drawing code a bit in preparation for tests.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user