From: Randolf S. <ran...@gm...> - 2009-09-17 06:54:32
|
Greetings, my rubberbanding code fails with Mesa7.5.1/Win32/GDI. The code draws with XOR directly to the front buffer, an looks like this: -snip- glDrawBuffer(GL_FRONT); glEnable(GL_COLOR_LOGIC_OP); glLogicOp(GL_XOR); glDisable(GL_DEPTH_TEST); // actual drawing using glBegin() glVertex() and friends omitted glEnable(GL_DEPTH_TEST); glLogicOp(GL_COPY); glDisable(GL_COLOR_LOGIC_OP); glFlush(); glDrawBuffer(GL_BACK); -snap- The rubberband is drawn but immediately cleared. This is because in wmesa.c:write_rgba_span_front() a BitBlt() occurs, that directly draws the rubberband, and in the glFlush() wmesa.c:wmesa_flush() another BitBlt() is done, that erases everything. Can we maybe check in wmesa_flush() whether the current buffer is the front buffer and do not do anything if this is the case (no idea whether this would affect drawing to the front buffer _without_ logic op enabled, those functions must then also BitBlt directly...)? Or should write_rgba_span_front() draw to a different place, that is later copied to the screen in wmesa_flush()? On my side, I can make my code work by omitting the glFlush(), however, I am hesitant to do so, because if the application runs over a network, a glFlush() seems quite appropriate for the special use case of rubberbanding. kind regards, Randolf |