- removed 'gldrawbuffer()' and 'glflush()' calls from main buttons loop.

these calls were done without anything actually happening, for each
  mouse move, and caused quite some slowdown at OSX.
  Might help the other platforms as well. Check it by just moving your mouse
  around, over window edges, buttons, etc. Especially Radiosity buttons
  were horrible slow in a large window

  Please be aware that the above calls cause a swapbuffer at OSX!
This commit is contained in:
2003-06-20 12:49:36 +00:00
parent 8fc4749167
commit 7c0712fb7f

View File

@@ -3221,7 +3221,7 @@ static void ui_do_active_linklines(uiBlock *block, short *mval)
uiBut *but;
uiLinkLine *line, *act= NULL;
float mindist= 12.0, fac, v1[2], v2[2], v3[3];
/* int foundone=0; */
int foundone= 0;
if(mval) {
v1[0]= mval[0];
@@ -3231,6 +3231,7 @@ static void ui_do_active_linklines(uiBlock *block, short *mval)
but= block->buttons.first;
while(but) {
if(but->type==LINK && but->link) {
foundone= 1;
line= but->link->lines.first;
while(line) {
v2[0]= line->from->x2;
@@ -3249,6 +3250,11 @@ static void ui_do_active_linklines(uiBlock *block, short *mval)
but= but->next;
}
}
/* check for a 'found one' to prevent going to 'frontbuffer' mode.
this slows done gfx quite some, and at OSX the 'finish' forces a swapbuffer */
if(foundone) {
/* draw */
glDrawBuffer(GL_FRONT);
@@ -3276,6 +3282,7 @@ static void ui_do_active_linklines(uiBlock *block, short *mval)
glFinish();
glDrawBuffer(GL_BACK);
}
}
/* return:
* UI_NOTHING pass event to other ui's
@@ -3461,7 +3468,6 @@ static int ui_do_block(uiBlock *block, uiEvent *uevent)
if(uevent->val || (block->flag & UI_BLOCK_RET_1)==0) {
if ELEM3(uevent->event, LEFTMOUSE, PADENTER, RETKEY) {
butevent= ui_do_button(block, but, uevent);
if(butevent) addqueue(block->winq, UI_BUT_EVENT, (short)butevent);