PDA

View Full Version : opengl and stereo



woshiwo
11-26-2002, 11:42 PM
i have some question.thia is my code.
------------------------------------------#include "stdafx.h"
#include <stdlib.h>
#include <gl/glut.h>


void init(void)
{ glClearColor(1.0,1.0,1.0,0.0);
GLfloat mat_ambient[]={0.2,0.2,0.2,1.0};
GLfloat mat_diffuse[]={1.0,1.0,1.0,1.0};
GLfloat mat_specular[]={1.0,1.0,1.0,1.0};
GLfloat mat_shininess[]={50.0};

GLfloat light0_diffuse[]={0.0,0.0,1.0,1.0};
GLfloat light0_position[]={1.0,1.0,1.0,0.0};

glMaterialfv(GL_FRONT,GL_AMBIENT,mat_ambient);
glMaterialfv(GL_FRONT,GL_DIFFUSE,mat_diffuse);
glMaterialfv(GL_FRONT,GL_SPECULAR,mat_specular);
glMaterialfv(GL_FRONT,GL_SHININESS,mat_shininess);

glLightfv(GL_LIGHT0,GL_DIFFUSE,light0_diffuse);
glLightfv(GL_LIGHT0,GL_POSITION,light0_position);

glDepthFunc(GL_LESS);
glEnable(GL_DEPTH_TEST);
}

void display(void)
{
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);

glPushMatrix();
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);


glRotatef(180.0,0.0,1.0,0.0);
glColor3f(1.0,1.0,1.0);
glutSolidTeapot(1.0);
glPopMatrix();
glFlush();
}

int main(int argc, char**argv)
{
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH| GLUT_STEREO );
glutInitWindowSize(400,400);
glutInitWindowPosition(100,100);
glutCreateWindow("teapot");
init();

glutDisplayFunc(display);
glutMainLoop();
return (0);
}
------------------------------------
when i run it.display that:
"visual with necessary capabilities not found"
my system was windows me.video card was GF4MX440.and the driver support opengl.and i have setup the 3D driver,it support opengl too.i can play opengl game.
who can help me.
thanks!

Bob
11-27-2002, 12:51 AM
If I remember correct, you have to install special drivers with stereo buffer capabilities.

Gavin
11-27-2002, 11:39 PM
Is it a stereo card?!