   Borders around multiple viewports
  Hi,I'm experimenting with multiple viewports, and got them to work, but not quite the way I was hoping for. First, here's my display function (pretty simple):edited February 4, 2004 3:30:20 PM to reflect Enigma's suggestion.  Still getting the same result void display(){glEnable(GL_SCISSOR_TEST);glViewport(0,0, (cxClient/2)-2, cyClient);glScissor(0,0, (cxClient/2)-2, cyClient);   glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);glMatrixMode(GL_PROJECTION);glLoadIdentity();gluPerspective(45.0f, (GLfloat)(cxClient/2)/(GLfloat)cyClient, 1.0f, 1000.0f);glMatrixMode(GL_MODELVIEW);glLoadIdentity();gluLookAt(0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);glScalef(1.0, 2.0, 1.0);// modeling transformationtesttriangle();// Force the draw and swapglFlush();glViewport((cxClient/2)+2, 0, (cxClient/2)-2, cyClient);glScissor((cxClient/2)+2, 0, (cxClient/2)-2, cyClient);glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);glMatrixMode(GL_PROJECTION);glLoadIdentity();gluPerspective(45.0f, (GLfloat)(cxClient/2)/(GLfloat)cyClient, 1.0f, 1000.0f);glMatrixMode(GL_MODELVIEW);glLoadIdentity();gluLookAt(0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);glScalef(1.0, 2.0, 1.0);// modeling transformationtesttriangle();// Force the draw and swapglFlush();SwapBuffers(g_HDC);}Like I said I got the two viewports running, but I wanted ~ 2 pixel border the native window background color around each viewport. I defined the background color in the WNDCLASSEX structure, and it displays fine when I don't call this display function. I thought the offset with both the viewport and Scissor test would restrict the OGL drawing into their respective regions, but I still lose the windows background color. Does anyone have any ideas? (I really don't want to manually draw the color in if I don't have to).Here's the screenshots of with and without the display function:http://www.forestmarkstudios.com/ss1.jpghttp://www.forestmarkstudios.com/ss2.jpg[edited by - NTense on February 4, 2004 5:03:15 PM]
  Do your clearing after the viewport/scissor calls (you''ll need to clear twice, once for each viewport).Enigma ;  I just gave that a try, and still no change  ...  I haven''t trapped the WM_PAINT in the WinProc.  Should I do something with that (I thought I was supposed to leave that be, but maybe not)?   