PDA

View Full Version : help me!!!how can i do about stereo buffer?



nuts
03-26-2000, 06:17 PM
i am working on programing with opengl &
vc++.now i have a question about the using of stero buffer.that is
to say,i nees to display two images on the monitor alternatively on
the Asus v3800(with a stero glasses).

I have try it several times.it does
not working.

this is part of my code.

PIXELFORMATDESCRIPTOR pfd =
{
sizeof(PIXELFORMATDESCRIPTOR), // size of this pfd
1, // version number
PFD_DRAW_TO_WINDOW| // support window
PFD_SUPPORT_OPENGL| // support OpenGL
// PFD_DOUBLEBUFFER|
PFD_STEREO,
PFD_TYPE_RGBA, // RGBA type
24, // 24-bit color depth
0, 0, 0, 0, 0, 0, // color bits ignored
0, // no alpha buffer
0, // shift bit ignored
0, 0, 0, 0, // accum bits ignored
32, // 32-bit z-buffer
0, // no stencil buffer
0, // no auxiliary buffer
PFD_MAIN_PLANE, // main layer
0, // reserved
0, 0, 0 // layer masks ignored
};

void CTest1View::OnMyshow()
{
// TODO: Add your command handler code here
HWND hWnd=GetSafeHwnd();
HDC hDC=::GetDC(hWnd);
wglMakeCurrent(hDC,hglrc);
myinit();
mydisplay(image1,image2);

wglMakeCurrent(NULL,NULL);
SwapBuffers(hDC);

}

..
..
..
void CTest1View::mydisplay(unsigned char *image1,unsigned char *image2)
{

for(int i=0;i<20;i++)
{
glDrawBuffer(GL_LEFT);
// glColorMask(1.0,1.0,1.0,1.0);
// glRasterPos2i(0.0,10);
glDrawPixels(DrawWidth1,DrawHeight1,GL_RGB,GL_UNSI GNED_BYTE,image1);


glDrawBuffer(GL_RIGHT);
// glColorMask(1.0,1.0,1.0,1.0);
// glRasterPos2i(100.0,10);
glDrawPixels(DrawWidth1,DrawHeight1,GL_RGB,GL_UNSI GNED_BYTE,image2);
glFlush();


}
}

Humus
03-27-2000, 01:15 AM
Have you checked that you actually revieved the stereo buffer you requested?

Rob
03-29-2000, 02:09 PM
I'd be very interested to hear if you get this working. I have been trying to do the same thing on my ASUS v6600 deluxe.

Unfortunately, I don't think you're going to be able to do it because I don't think that the ASUS cards support the stereo buffers. I tried running some samples from the NT SDK here: http://www.stereographics.com/html/crystaleyes_sdks.html
None of the samples work. They all come back with an error about stereo not being supported.

Definitely let me know if you figure it out though.
Good luck
-Rob