diff options
-rw-r--r-- | source/blender/src/drawmesh.c | 13 | ||||
-rw-r--r-- | source/blender/src/drawobject.c | 6 | ||||
-rw-r--r-- | source/blender/src/drawview.c | 2 | ||||
-rw-r--r-- | source/blender/src/editmesh.c | 16 | ||||
-rw-r--r-- | source/blender/src/editscreen.c | 4 | ||||
-rw-r--r-- | source/blender/src/editview.c | 2 | ||||
-rw-r--r-- | source/blender/src/filesel.c | 2 | ||||
-rw-r--r-- | source/blender/src/glutil.c | 2 | ||||
-rw-r--r-- | source/blender/src/interface.c | 34 | ||||
-rw-r--r-- | source/blender/src/mywindow.c | 2 | ||||
-rw-r--r-- | source/blender/src/previewrender.c | 2 | ||||
-rw-r--r-- | source/blender/src/swapbuffers.c | 4 | ||||
-rw-r--r-- | source/blender/src/toolbox.c | 8 |
13 files changed, 49 insertions, 48 deletions
diff --git a/source/blender/src/drawmesh.c b/source/blender/src/drawmesh.c index 873b3c9ab9f..854f474f6bb 100644 --- a/source/blender/src/drawmesh.c +++ b/source/blender/src/drawmesh.c @@ -386,10 +386,13 @@ int set_tpage(TFace *tface) glGenTextures(1, (GLuint *)bind); - if(G.f & G_DEBUG) { - printf("var1: %s\n", ima->id.name+2); - printf("var1: %d, var2: %d\n", *bind, tpx); - printf("var1: %d, var2: %d\n", fCurtile, tilemode); + if((G.f & G_DEBUG) || !*bind) { + GLenum error = glGetError(); + printf("Texture: %s\n", ima->id.name+2); + printf("name: %d, tpx: %d\n", *bind, tpx); + printf("tile: %d, mode: %d\n", fCurtile, tilemode); + if (error) + printf("error: %d\n", error); } glBindTexture( GL_TEXTURE_2D, *bind); @@ -416,8 +419,6 @@ int set_tpage(TFace *tface) } else glBindTexture( GL_TEXTURE_2D, *bind); - - glEnable(GL_TEXTURE_2D); fCurpage= ima; diff --git a/source/blender/src/drawobject.c b/source/blender/src/drawobject.c index 48c02654fe1..dc22eda64bc 100644 --- a/source/blender/src/drawobject.c +++ b/source/blender/src/drawobject.c @@ -240,7 +240,7 @@ static void draw_icon_centered(float *pos, unsigned int *rect, int rectsize) /* use bitmap to shift rasterpos in pixels */ glBitmap(0, 0, 0.0, 0.0, -hsize, -hsize, &dummy); #if defined (__sun__) || defined ( __sun ) || defined (__sparc) || defined (__sparc__) - glFinish(); + glFlush(); #endif glDrawPixels(rectsize, rectsize, GL_RGBA, GL_UNSIGNED_BYTE, rect); } @@ -270,7 +270,7 @@ void helpline(float *vec) setlinestyle(0); persp(PERSP_VIEW); - glFinish(); // flush display for frontbuffer + glFlush(); // flush display for frontbuffer glDrawBuffer(GL_BACK); } @@ -3830,7 +3830,7 @@ void draw_object_ext(Base *base) G.f &= ~G_DRAW_EXT; - glFinish(); /* reveil frontbuffer drawing */ + glFlush(); /* reveil frontbuffer drawing */ glDrawBuffer(GL_BACK); if(G.zbuf) { diff --git a/source/blender/src/drawview.c b/source/blender/src/drawview.c index 96a09783630..5777964a803 100644 --- a/source/blender/src/drawview.c +++ b/source/blender/src/drawview.c @@ -2046,7 +2046,7 @@ void drawview3d_render(struct View3D *v3d) G.f &= ~G_SIMULATION; - glFinish(); + glFlush(); glReadPixels(0, 0, R.rectx, R.recty, GL_RGBA, GL_UNSIGNED_BYTE, R.rectot); glLoadIdentity(); diff --git a/source/blender/src/editmesh.c b/source/blender/src/editmesh.c index 59c2b4206de..d427b38dda8 100644 --- a/source/blender/src/editmesh.c +++ b/source/blender/src/editmesh.c @@ -3369,7 +3369,7 @@ void mouse_mesh(void) countall(); - glFinish(); + glFlush(); glDrawBuffer(GL_BACK); /* signal that frontbuf differs from back */ @@ -7976,7 +7976,7 @@ CutCurve *get_mouse_trail(int *len, char mode){ if( event==ESCKEY || event==RIGHTMOUSE ) { if (curve) MEM_freeN(curve); *len=0; - glFinish(); + glFlush(); glDrawBuffer(GL_BACK); return(NULL); break; @@ -7986,7 +7986,7 @@ CutCurve *get_mouse_trail(int *len, char mode){ glLineWidth(2.0); sdrawXORline(curve[i-1].x, curve[i-1].y,mval[0], mval[1]); glLineWidth(1.0); - glFinish(); + glFlush(); rubberband=0; } @@ -8009,7 +8009,7 @@ CutCurve *get_mouse_trail(int *len, char mode){ if (restart) { for(j=1;j<i;j++) sdrawXORline(curve[j-1].x, curve[j-1].y, curve[j].x, curve[j].y); if (rubberband) sdrawXORline(curve[j].x, curve[j].y, mval[0], mval[1]); - glFinish(); + glFlush(); rubberband=0; lasti=i=0; restart=0; @@ -8031,14 +8031,14 @@ CutCurve *get_mouse_trail(int *len, char mode){ if ((i>1)&&(i!=lasti)) { /*Draw recorded part of curve */ sdrawline(curve[i-2].x, curve[i-2].y, curve[i-1].x, curve[i-1].y); - glFinish(); + glFlush(); } if ((i==lasti)&&(i>0)) { /*Draw rubberband */ glLineWidth(2.0); sdrawXORline(curve[i-1].x, curve[i-1].y,mval[0], mval[1]); glLineWidth(1.0); - glFinish(); + glFlush(); rubberband=1; } lasti=i; @@ -8056,7 +8056,7 @@ CutCurve *get_mouse_trail(int *len, char mode){ } } - glFinish(); + glFlush(); glDrawBuffer(GL_BACK); persp(PERSP_VIEW); @@ -9188,7 +9188,7 @@ void bevel_menu() setlinestyle(0); persp(PERSP_VIEW); - glFinish(); // flush display for frontbuffer + glFlush(); // flush display for frontbuffer glDrawBuffer(GL_BACK); } while(qtest()) { diff --git a/source/blender/src/editscreen.c b/source/blender/src/editscreen.c index 873a709fc93..393db3c17de 100644 --- a/source/blender/src/editscreen.c +++ b/source/blender/src/editscreen.c @@ -624,7 +624,7 @@ void splash(void *data, int datasize, char *string) BMF_DrawString(font, string); } - glFinish(); + glFlush(); glDrawBuffer(GL_BACK); IMB_freeImBuf(bbuf); @@ -3019,7 +3019,7 @@ void screen_draw_info_text(bScreen *sc, char *text) { glRasterPos2i(x, y); BMF_DrawString(G.fonts, text); - glFinish(); + glFlush(); glDrawBuffer(GL_BACK); sa->head_swap= WIN_FRONT_OK; diff --git a/source/blender/src/editview.c b/source/blender/src/editview.c index d681c2d50b0..76bb6d56608 100644 --- a/source/blender/src/editview.c +++ b/source/blender/src/editview.c @@ -887,7 +887,7 @@ void borderselect(void) base= base->next; } /* frontbuffer flush */ - glFinish(); + glFlush(); allqueue(REDRAWDATASELECT, 0); diff --git a/source/blender/src/filesel.c b/source/blender/src/filesel.c index 9597af86250..8b1d60ee703 100644 --- a/source/blender/src/filesel.c +++ b/source/blender/src/filesel.c @@ -1084,7 +1084,7 @@ static void set_active_file(SpaceFile *sfile, int act) glScissor(curarea->winrct.xmin, curarea->winrct.ymin, curarea->winx, curarea->winy); - glFinish(); /* for geforce, to show it in the frontbuffer */ + glFlush(); /* for geforce, to show it in the frontbuffer */ glDrawBuffer(GL_BACK); } else if(redraw) { diff --git a/source/blender/src/glutil.c b/source/blender/src/glutil.c index 328764984c1..0464942cdd6 100644 --- a/source/blender/src/glutil.c +++ b/source/blender/src/glutil.c @@ -89,7 +89,7 @@ void glutil_draw_front_xor_line(int x0, int y0, int x1, int y1) { glDrawBuffer(GL_FRONT); sdrawXORline(x0, y0, x1, y1); - glFinish(); + glFlush(); glDrawBuffer(GL_BACK); } diff --git a/source/blender/src/interface.c b/source/blender/src/interface.c index d9ce29fad14..7966355d3d3 100644 --- a/source/blender/src/interface.c +++ b/source/blender/src/interface.c @@ -248,7 +248,7 @@ static uiSaveUnder *ui_bgnpupdraw(int startx, int starty, int endx, int endy, in glDrawBuffer(GL_FRONT); /* for geforce and other cards */ - glFinish(); + glFlush(); su= ui_save_under(startx-1, starty-1, endx-startx+2, endy-starty+6); if(su) su->oldwin= oldwin; @@ -269,7 +269,7 @@ static void ui_endpupdraw(uiSaveUnder *su) glReadBuffer(GL_FRONT); glDrawBuffer(GL_FRONT); - glFinish(); + glFlush(); if(su) { ui_paste_under(su); @@ -1029,7 +1029,7 @@ static int ui_do_but_BUT(uiBut *but) if (but->flag != oflag) { ui_draw_but(but); - glFinish(); // flush display in subloops + glFlush(); // flush display in subloops } PIL_sleep_ms(10); @@ -1178,7 +1178,7 @@ static int ui_do_but_TEX(uiBut *but) BLI_strncpy(backstr, but->poin, UI_MAX_DRAW_STR); ui_draw_but(but); - glFinish(); // flush display in subloops + glFlush(); // flush display in subloops while (get_mbut() & L_MOUSE) BIF_wait_for_statechange(); len= strlen(str); @@ -1274,7 +1274,7 @@ static int ui_do_but_TEX(uiBut *but) if(dodraw) { ui_check_but(but); ui_draw_but(but); - glFinish(); // flush display in subloops + glFlush(); // flush display in subloops } } @@ -1356,7 +1356,7 @@ static int ui_do_but_NUM(uiBut *but) but->flag |= UI_SELECT; ui_draw_but(but); - glFinish(); // flush display before subloop + glFlush(); // flush display before subloop uiGetMouse(mywinget(), mval); value= ui_get_but_val(but); @@ -1414,7 +1414,7 @@ static int ui_do_but_NUM(uiBut *but) ui_set_but_val(but, (double)temp); ui_check_but(but); ui_draw_but(but); - glFinish(); // flush display in subloops + glFlush(); // flush display in subloops uibut_do_func(but); } @@ -1438,7 +1438,7 @@ static int ui_do_but_NUM(uiBut *but) ui_set_but_val(but, tempf); ui_check_but(but); ui_draw_but(but); - glFinish(); // flush display in subloops + glFlush(); // flush display in subloops } } @@ -1473,7 +1473,7 @@ static int ui_do_but_NUM(uiBut *but) but->flag &= ~UI_SELECT; ui_check_but(but); ui_draw_but(but); - glFinish(); // flush display in subloops + glFlush(); // flush display in subloops return but->retval; } @@ -1702,7 +1702,7 @@ static int ui_do_but_SLI(uiBut *but) ui_set_but_val(but, tempf); ui_check_but(but); ui_draw_but(but); - glFinish(); // flush display in subloops + glFlush(); // flush display in subloops if(but->a1) { /* color number */ uiBut *bt= but->prev; @@ -1754,7 +1754,7 @@ static int ui_do_but_SLI(uiBut *but) } ui_check_but(but); ui_draw_but(but); - glFinish(); // flush display in subloops + glFlush(); // flush display in subloops return but->retval; } @@ -2157,7 +2157,7 @@ static void edit_but(uiBlock *block, uiBut *but, uiEvent *uevent) but->y2 += dy; ui_draw_but(but); - glFinish(); + glFlush(); didit= 1; but->rt[3]= 1; @@ -2910,7 +2910,7 @@ static uiSaveUnder *ui_draw_but_tip(uiBut *but) glRasterPos2f( x1+3, y1+5); BIF_DrawString(but->font, but->tip, (U.transopts & USER_TR_TOOLTIPS)); - glFinish(); /* to show it in the frontbuffer */ + glFlush(); /* to show it in the frontbuffer */ return su; } @@ -2987,7 +2987,7 @@ int uiDoBlocks(ListBase *lb, int event) uevent.event= event; uevent.val= 1; - /* this is a caching mechanism, to prevent too many calls to glFrontBuffer and glFinish, which slows down interface */ + /* this is a caching mechanism, to prevent too many calls to glFrontBuffer and glFlush, which slows down interface */ block= lb->first; while(block) { block->frontbuf= UI_NEED_DRAW_FRONT; // signal @@ -3023,7 +3023,7 @@ int uiDoBlocks(ListBase *lb, int event) /* is there a glfinish cached? */ if(block->frontbuf == UI_HAS_DRAW_FRONT) { - glFinish(); + glFlush(); glDrawBuffer(GL_BACK); block->frontbuf= UI_NEED_DRAW_FRONT; } @@ -3055,7 +3055,7 @@ int uiDoBlocks(ListBase *lb, int event) /* need to reveil drawing? (not in end of loop, because of free block */ if(block->frontbuf == UI_HAS_DRAW_FRONT) { - glFinish(); + glFlush(); block->frontbuf= UI_NEED_DRAW_FRONT; } @@ -3095,7 +3095,7 @@ int uiDoBlocks(ListBase *lb, int event) /* cleanup frontbuffer & flags */ block= lb->first; while(block) { - if(block->frontbuf==UI_HAS_DRAW_FRONT) glFinish(); + if(block->frontbuf==UI_HAS_DRAW_FRONT) glFlush(); block->frontbuf= 0; block= block->next; } diff --git a/source/blender/src/mywindow.c b/source/blender/src/mywindow.c index 89b58337081..3e0909eb99e 100644 --- a/source/blender/src/mywindow.c +++ b/source/blender/src/mywindow.c @@ -349,7 +349,7 @@ void mywinset(int wid) glMatrixMode(GL_MODELVIEW); glLoadMatrixf(&win->viewmat[0][0]); - glFinish(); + glFlush(); curswin= wid; } diff --git a/source/blender/src/previewrender.c b/source/blender/src/previewrender.c index 9cf3caa92c9..cb94d0b327a 100644 --- a/source/blender/src/previewrender.c +++ b/source/blender/src/previewrender.c @@ -288,7 +288,7 @@ static void display_pr_scanline(unsigned int *rect, int recty) /* flush opengl for cards with frontbuffer slowness */ if(recty==PR_RECTY-1 || (PIL_check_seconds_timer() - lasttime > 0.05)) { lasttime= PIL_check_seconds_timer(); - glFinish(); + glFlush(); } } diff --git a/source/blender/src/swapbuffers.c b/source/blender/src/swapbuffers.c index 8cc25254a29..3cedfdf6302 100644 --- a/source/blender/src/swapbuffers.c +++ b/source/blender/src/swapbuffers.c @@ -82,12 +82,12 @@ static void copy_back_to_front(void) glDrawBuffer(GL_FRONT); glCopyPixels(0, 0, winx, winy, GL_COLOR); glDrawBuffer(GL_BACK); - glFinish(); + glFlush(); if (actually_swap) { glRasterPos2f(-0.5,-0.5); glDrawPixels(winx, winy, GL_RGBA, GL_UNSIGNED_BYTE, data); - glFinish(); + glFlush(); free(data); } } diff --git a/source/blender/src/toolbox.c b/source/blender/src/toolbox.c index dc5adb4bc68..26a947d7022 100644 --- a/source/blender/src/toolbox.c +++ b/source/blender/src/toolbox.c @@ -500,7 +500,7 @@ void bgnpupdraw(int startx, int starty, int endx, int endy) glReadBuffer(GL_FRONT); glDrawBuffer(GL_FRONT); - glFinish(); + glFlush(); my_get_frontbuffer_image(startx-1, starty-4, endx-startx+5, endy-starty+6); @@ -512,7 +512,7 @@ void bgnpupdraw(int startx, int starty, int endx, int endy) void endpupdraw(void) { - glFinish(); + glFlush(); my_put_frontbuffer_image(); if(tboldwin) { @@ -939,7 +939,7 @@ void drawtoolbox(void) } } - glFinish(); /* for geforce, to show it in the frontbuffer */ + glFlush(); /* for geforce, to show it in the frontbuffer */ } @@ -1020,7 +1020,7 @@ void toolbox(void) tbox_drawelem(actx, acty, 3); } - glFinish(); /* for geforce, to show it in the frontbuffer */ + glFlush(); /* for geforce, to show it in the frontbuffer */ xo= actx; yo= acty; |