this program complies on my msvc++ complier but when execute it ,by the way its windows console appl… I dont get the open gl window i get the console window with a error message saying FATAL ERROR IN (UNAMED): PIXEL FORMAT WITH NECESSARY CAPABILITIES NOT FOUND d. Today I put the glut32.dlls in the win system dir and the glut.h in th include\gl and everthing else. Also i ran the first program in the opengl superbible 2nd ed. just fine… whats wrong !!
please help!!!
// glrect.cpp : Defines the entry point for the console application.
//
#include “stdafx.h”
#include <windows.h>
#include <gl\glut.h>
void RenderScene(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0f,0.0f,0.0f);
glRectf(100.0f,150.0f,150.0f,100.0f);
glFlush();
}
void SetupRC(void)
{
glClearColor(0.0f,0.0f,1.0f,1.0f);
}
void ChangeSize(GLsizei w, GLsizei h)
{
if (h==0)
h = 1;
glViewport(0,0,w,h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
if (w<=h)
glOrtho(0.0f,250.0f,0.0f,250.0f*h/w,1.0,-1.0);
else
glOrtho(0.0f,250.0f*w/h,0.0f,250.0f,1.0,-1.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}
void main(void)
{
glutInitDisplayMode(GLUT_SINGLE|GL_RGB);
glutCreateWindow(“ernie”);
glutDisplayFunc(RenderScene);
glutReshapeFunc(ChangeSize);
SetupRC();
glutMainLoop();
}
thank you