- OSX bugfix: drawing selection code for vpaint and faceselect happens in AUX
buffers now. It only works nice at OSX (tested, linux and windows do not support it nicely) This fixes the annoying flashing during paint or select
This commit is contained in:
@@ -703,7 +703,9 @@ void backdrawview3d(int test)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __APPLE__
|
||||
glDrawBuffer(GL_AUX0);
|
||||
#endif
|
||||
if(G.vd->drawtype > OB_WIRE) G.zbuf= TRUE;
|
||||
curarea->win_swap &= ~WIN_BACK_OK;
|
||||
|
||||
@@ -758,6 +760,10 @@ void backdrawview3d(int test)
|
||||
G.zbuf= FALSE;
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
glEnable(GL_DITHER);
|
||||
|
||||
#ifdef __APPLE__
|
||||
glDrawBuffer(GL_BACK); /* we were in aux buffers */
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@@ -445,8 +445,13 @@ TFace* face_pick(Mesh *me, short x, short y)
|
||||
backdrawview3d(0);
|
||||
}
|
||||
/* Read the pixel under the cursor */
|
||||
#ifdef __APPLE__
|
||||
glReadBuffer(GL_AUX0);
|
||||
#endif
|
||||
glReadPixels(x+curarea->winrct.xmin, y+curarea->winrct.ymin, 1, 1,
|
||||
GL_RGBA, GL_UNSIGNED_BYTE, &col);
|
||||
glReadBuffer(GL_BACK);
|
||||
|
||||
/* Unbelievable! */
|
||||
if (G.order==B_ENDIAN) {
|
||||
SWITCH_INT(col);
|
||||
@@ -532,8 +537,11 @@ void face_borderselect()
|
||||
|
||||
val= get_border(&rect, 3);
|
||||
|
||||
/* why readbuffer here? shouldn't be necessary */
|
||||
/* why readbuffer here? shouldn't be necessary (maybe a flush or so) */
|
||||
glReadBuffer(GL_BACK);
|
||||
#ifdef __APPLE__
|
||||
glReadBuffer(GL_AUX0); /* apple only */
|
||||
#endif
|
||||
|
||||
if(val) {
|
||||
selar= MEM_callocN(me->totface+1, "selar");
|
||||
@@ -571,6 +579,9 @@ void face_borderselect()
|
||||
allqueue(REDRAWVIEW3D, 0);
|
||||
allqueue(REDRAWIMAGE, 0);
|
||||
}
|
||||
#ifdef __APPLE__
|
||||
glReadBuffer(GL_BACK);
|
||||
#endif
|
||||
}
|
||||
|
||||
#define TEST_STRUBI 1
|
||||
|
@@ -903,6 +903,7 @@ void screenmain(void)
|
||||
{
|
||||
int has_input= 1;
|
||||
int firsttime = 1;
|
||||
|
||||
while (1) {
|
||||
unsigned short event;
|
||||
short val, towin;
|
||||
|
@@ -486,8 +486,13 @@ static int event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr private) {
|
||||
/*
|
||||
* XXX quick hack so OSX version works better
|
||||
* when the window is clicked on (focused).
|
||||
*
|
||||
* it used to pass on the old win->lmouse value,
|
||||
* which causes a wrong click in Blender.
|
||||
* Actually, a 'focus' click should not be passed
|
||||
* on to blender... (ton)
|
||||
*/
|
||||
if(1) {
|
||||
if(1) { /* enables me to add locals */
|
||||
int cx, cy, wx, wy;
|
||||
GHOST_GetCursorPosition(g_system, &wx, &wy);
|
||||
|
||||
|
@@ -112,10 +112,11 @@ static void screen_swapbuffers_REDRAW(bScreen *sc)
|
||||
|
||||
sa= sc->areabase.first;
|
||||
while(sa) {
|
||||
|
||||
swap= sa->win_swap;
|
||||
if( (swap & WIN_BACK_OK) == 0) {
|
||||
|
||||
scrarea_do_windraw(sa);
|
||||
|
||||
doswap= 1;
|
||||
sa->win_swap= swap | WIN_BACK_OK;
|
||||
}
|
||||
|
@@ -596,8 +596,12 @@ static int sample_backbuf_area(int x, int y)
|
||||
y2= y+Gvp.size;
|
||||
CLAMP(y1, 0, curarea->winy);
|
||||
CLAMP(y2, 0, curarea->winy);
|
||||
|
||||
#ifdef __APPLE__
|
||||
glReadBuffer(GL_AUX0);
|
||||
#endif
|
||||
glReadPixels(x1+curarea->winrct.xmin, y1+curarea->winrct.ymin, x2-x1+1, y2-y1+1, GL_RGBA, GL_UNSIGNED_BYTE, rect);
|
||||
glReadBuffer(GL_BACK);
|
||||
|
||||
if(G.order==B_ENDIAN) IMB_convert_rgba_to_abgr( (int)(4*Gvp.size*Gvp.size), rect);
|
||||
|
||||
rt= rect;
|
||||
@@ -633,7 +637,12 @@ static unsigned int sample_backbuf(int x, int y)
|
||||
x+= curarea->winrct.xmin;
|
||||
y+= curarea->winrct.ymin;
|
||||
|
||||
#ifdef __APPLE__
|
||||
glReadBuffer(GL_AUX0);
|
||||
#endif
|
||||
glReadPixels(x, y, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &col);
|
||||
glReadBuffer(GL_BACK);
|
||||
|
||||
if(G.order==B_ENDIAN) SWITCH_INT(col);
|
||||
|
||||
return framebuffer_to_index(col);
|
||||
@@ -1074,8 +1083,8 @@ void vertex_paint()
|
||||
|
||||
scrarea_do_windraw(curarea);
|
||||
screen_swapbuffers();
|
||||
backdrawview3d(0);
|
||||
draw_sel_circle(mval, 0, Gvp.size, Gvp.size, 0);
|
||||
backdrawview3d(0);
|
||||
|
||||
mvalo[0]= mval[0];
|
||||
mvalo[1]= mval[1];
|
||||
|
Reference in New Issue
Block a user