- further cleanup of window matrix code. Now ALL 2d ortho calls are

using an identical offset; which is 0.375 and official recommended
  by OpenGL.
  This to further investigate the AA font errors on some systems
  with ATI cards.
This commit is contained in:
2003-11-12 21:14:30 +00:00
parent e9d9a7282e
commit 1c8ae70249
7 changed files with 15 additions and 12 deletions

View File

@@ -455,7 +455,7 @@ void drawbutspace(ScrArea *sa, void *spacedata)
sbuts->mainbo= sbuts->mainb;
sbuts->tabo= sbuts->tab[sbuts->mainb];
myortho2(-0.5, (float)(sa->winx)-.05, -0.5, (float)(sa->winy)-0.5);
myortho2(-0.5, (float)(sa->winx)-0.5, -0.5, (float)(sa->winy)-0.5);
draw_area_emboss(sa);
myortho2(v2d->cur.xmin, v2d->cur.xmax, v2d->cur.ymin, v2d->cur.ymax);

View File

@@ -1068,7 +1068,7 @@ static void render_panel_anim()
uiBlockSetCol(block, TH_AUTO);
uiDefBut(block, BUT,B_PLAYANIM, "PLAY", 692,40,94,33, 0, 0, 0, 0, 0, "Play animation of rendered images/avi (searches Pics: field)");
uiDefButS(block, NUM, B_RTCHANGED, "rt:", 790,40,95,33, &G.rt, 0.0, 256.0, 0, 0, "General testing/debug button");
uiDefButS(block, NUM, B_RTCHANGED, "rt:", 790,40,95,33, &G.rt, -1000.0, 1000.0, 0, 0, "General testing/debug button");
uiDefButS(block, NUM,REDRAWSEQ,"Sta:", 692,10,94,24, &G.scene->r.sfra,1.0,18000.0, 0, 0, "The start frame of the animation");
uiDefButS(block, NUM,REDRAWSEQ,"End:", 790,10,95,24, &G.scene->r.efra,1.0,18000.0, 0, 0, "The end frame of the animation");

View File

@@ -142,7 +142,7 @@ void viewgate(short sx, short sy, short ex, short ey)
wx = curarea->winrct.xmin; wy = curarea->winrct.ymin;
glViewport(wx+sx, wy+sy, (wx+ex )-(wx+sx)+1, (wy+ey )-(wy+sy)+1);
glScissor(wx+sx, wy+sy, (wx+ex )-(wx+sx)+1, (wy+ey )-(wy+sy)+1);
myortho2((float)sx+0.5 , (float)ex+0.5, (float)sy+0.5, (float)ey+0.5);
myortho2((float)sx-0.5 , (float)ex-0.5, (float)sy-0.5, (float)ey-0.5);
}
void areaview (void)

View File

@@ -552,7 +552,7 @@ void drawtextspace(ScrArea *sa, void *spacedata)
BIF_GetThemeColor3fv(TH_BACK, col);
glClearColor(col[0], col[1], col[2], 0.0);
glClear(GL_COLOR_BUFFER_BIT);
myortho2(-0.5, (float)(sa->winx)-.05, -0.5, (float)(sa->winy)-0.5);
myortho2(-0.5, (float)(sa->winx)-0.5, -0.5, (float)(sa->winy)-0.5);
draw_area_emboss(sa);

View File

@@ -2926,7 +2926,7 @@ void drawscreen(void)
ScrArea *sa;
mywinset(G.curscreen->mainwin);
myortho2(-0.5, (float)G.curscreen->sizex-0.5, -0.51, (float)G.curscreen->sizey-0.51);
myortho2(-0.5, (float)G.curscreen->sizex-0.5, -0.5, (float)G.curscreen->sizey-0.5);
sa= G.curscreen->areabase.first;
while(sa) {

View File

@@ -97,7 +97,7 @@ void mywindow_init_mainwin(Window *win, int orx, int ory, int sizex, int sizey)
mainwindow.ymax= ory+sizey-1;
mainwindow.qevents= NULL;
myortho2(-0.5, (float)sizex-0.5, -0.6, (float)sizey-0.6);
myortho2(-0.5, (float)sizex-0.5, -0.5, (float)sizey-0.5);
glLoadIdentity();
glGetFloatv(GL_PROJECTION_MATRIX, (float *)mainwindow.winmat);
@@ -427,10 +427,15 @@ void mywinposition(int winid, int xmin, int xmax, int ymin, int ymax) /* watch:
void bwin_ortho(int winid, float x1, float x2, float y1, float y2, float n, float f)
{
bWindow *bwin= bwin_from_winid(winid);
float offs= 0.125;
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(x1, x2, y1, y2, n, f);
// in blender it's always called with -0.5... according to opengl
// manual it should be (-)0.375 for correctness.
//offs= 0.01*G.rt;
glOrtho(x1+offs, x2+offs, y1+offs, y2+offs, n, f);
glGetFloatv(GL_PROJECTION_MATRIX, (float *)bwin->winmat);
glMatrixMode(GL_MODELVIEW);
@@ -438,9 +443,7 @@ void bwin_ortho(int winid, float x1, float x2, float y1, float y2, float n, floa
void bwin_ortho2(int win, float x1, float x2, float y1, float y2)
{
// in blender it's always called with -0.5... according to opengl
// manual it should 0.375 for correctness. added for test
bwin_ortho(win, x1+0.125, x2+0.125, y1+0.125, y2+0.125, -1, 1);
bwin_ortho(win, x1, x2, y1, y2, -1, 1);
}
void bwin_frustum(int winid, float x1, float x2, float y1, float y2, float n, float f)

View File

@@ -2436,7 +2436,7 @@ void drawinfospace(ScrArea *sa, void *spacedata)
uiDrawBlock(block);
myortho2(-0.5, (float)(sa->winx)-.05, -0.5, (float)(sa->winy)-0.5);
myortho2(-0.5, (float)(sa->winx)-0.5, -0.5, (float)(sa->winy)-0.5);
draw_area_emboss(sa);
myortho2(0.0, 1280.0, 0.0, curarea->winy/fac);
sa->win_swap= WIN_BACK_OK;
@@ -2537,7 +2537,7 @@ static void changebutspace(ScrArea *sa, void *spacedata)
if(G.v2d==0) return;
test_view2d(G.v2d, curarea->winx, curarea->winy);
myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin-0.6, G.v2d->cur.ymax+0.6);
myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax);
}
void winqreadbutspace(ScrArea *sa, void *spacedata, BWinEvent *evt)