PDA

View Full Version : Pixel format with necessary capabilities not found



JLawson
10-23-2001, 07:12 PM
thats an error I get.. what does it mean? Im trying to compile

#include <windows.h>
#include <gl/glut.h>
#include <gl/glu.h>
#include <gl/gl.h>

//FUNCTION DECLARATIONS
void initGL(void);
void keyDown(unsigned char key, int x, int y);

//MAIN FUNCTION
void main(int argc, char **argv){
glutInit(&argc, argv);
glutInitWindowPosition(1,1);
glutInitWindowSize(320,320);
glutInitDisplayMode(GL_DEPTH|GL_DOUBLE|GL_RGBA);
glutCreateWindow("hello world.");
glutFullScreen();
glutKeyboardFunc(keyDown);
glutDisplayFunc(initGL);
glutMainLoop();
}

//KEYPRESS FUNCTION
void keyDown(unsigned char key, int x, int y){
switch(key){
case 27: exit(1); break;
default: break;
}
}

//RENDER SCENE
void initGL(void){
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
glEnable(GL_DEPTH_TEST);
glEnable(GL_LIGHTING);

//Now make an instance of light, and declare its position
glEnable(GL_LIGHT1); static GLfloat Light1Pos[]={0.0,0.0,1.0, 0.0};

glLightfv(GL_LIGHT1, GL_POSITION, Light1Pos);
glColor4f(1.0f, 1.0f, 1.0f, 0.5f);
glBegin(GL_QUADS);
glVertex3f(-5.0, 5.0, 0.0);
glVertex3f(-5.0,-5.0, 0.0);
glVertex3f( 5.0, 5.0, 0.0);
glVertex3f( 5.0,-5.0, 0.0);
glEnd();
glutSwapBuffers();
}

I mean, it compiles and builds fine, but when I execute, a dos window pops up and says the error...

help! please!

Tron
10-23-2001, 07:47 PM
i never worked with GLUT, but according to a quick look at a documentation:




glutInitDisplayMode(GL_DEPTH|GL_DOUBLE|GL_RGBA);


shouldn't the parameters be: GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA ?