+ glViewport(0, 0, win_width, win_height);
+
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+ glMatrixMode(GL_PROJECTION);
+ glPushMatrix();
+ glLoadIdentity();
+ glOrtho(0, win_width, win_height, 0, -1, 1);
+
+ glRasterPos2i(0, 0);
+ glPixelZoom(1, -1);
+ glEnable(GL_ALPHA_TEST);
+ glAlphaFunc(GL_GREATER, 0.5f);
+ glDrawPixels(win_width, win_height, GL_BGRA, GL_UNSIGNED_BYTE, framebuf);
+ glDisable(GL_ALPHA_TEST);
+
+ if(rband.width | rband.height) {
+ glPushAttrib(GL_ENABLE_BIT);
+ glDisable(GL_DEPTH_TEST);
+ glDisable(GL_LIGHTING);
+
+ glEnable(GL_COLOR_LOGIC_OP);
+ glLogicOp(GL_XOR);
+
+ glBegin(GL_LINE_LOOP);
+ glColor3f(1, 1, 1);
+ glVertex2f(rband.x, rband.y);
+ glVertex2f(rband.x + rband.width, rband.y);
+ glVertex2f(rband.x + rband.width, rband.y + rband.height);
+ glVertex2f(rband.x, rband.y + rband.height);
+ glEnd();
+
+ glPopAttrib();
+ }
+
+ glPopMatrix();
+ glMatrixMode(GL_MODELVIEW);
+