Jump to content
  • Advertisement
Sign in to follow this  
ManaStone

OpenGL glx.h question

This topic is 5227 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am going to start an OpenGL course and I am trying to get a head start on it by compiling this simple program that was in the book:
#include <windows.h>
#include <gl/Gl.h>
#include<gl/glut.h>

void myInit(void)
{

	glClearColor(1.0,1.0,1.0,0.0);
	glColor3f(0.0f,0.0f,0.0f);
	glPointSize(4.0);
	glMatrixMode(GL_PROJECTION);	
	glLoadIdentity();
	gluOrtho2d(0.0,640.0,0.0,480.0);


}

void myDisplay(void)
{
	glClear(GL_COLOR_BUFFER_BIT);
	glBegin(GL_POINTS);
		glVertex2i(100,50);
		glVertex2i(100,130);
		glVertex2i(150,130);
		glEnd()
	glFlush();
}


void main(int argc, char** argv)
{
	glutInit(&argc,argv);
	glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
	glutInitWindowSize(640,480);
	glutCreateWindow("my first attempt");
	glutDisplayFunc(myDisplay);
	myInit();
	glutMainLoop();
}

Whenever I try to compile it, I get an error from my gl.h header that says that a header included in it (glx.h) doesn’t exist. This file doesn’t exist anywhere on my computer. Am I just missing this file, or does it not come with the windows openGL or what? Anyway, when I try to comment out the glx.h header, I get a warning and a different error saying: c:\program files\microsoft visual studio\vc98\include\gl\gl.h(2) : warning C4182: #include nesting level is 362 deep; possible infinite recursion c:\program files\microsoft visual studio\vc98\include\gl\gl.h(2) : fatal error C1076: compiler limit : internal heap limit reached; use /Zm to specify a higher limit

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Whenever I try to compile it, I get an error from my gl.h header that says that a header included in it (glx.h) doesn’t exist. This file doesn’t exist anywhere on my computer. Am I just missing this file, or does it not come with the windows openGL or what?

I don't think glx.h should exist on your computer - it's for X Windows.. Where did you get your gl.h?

Also, you can replace the lines:
#include <windows.h>
#include <gl/Gl.h>
#include<gl/glut.h>

by simply
#include <GL/glut.h>

It will keep things portable :P

Share this post


Link to post
Share on other sites
I'm not sure why my gl.h file was like that; maybe I’ve overwritten the original. I’ve got the correct one now, but I’ve got another problem. Where do I get the Glut32.lib and Glut32.dll files?

I can get the ones for win 95 and NT from http://www.opengl.org/resources/libraries/glut.html , but I’ve got XP. Should it be alright with XP?

Share this post


Link to post
Share on other sites
You could either get the source and compile it yourself, or download binaries from here.
(I don't know if the ones on opengl.org work on XP - they probably do, but the ones linked above specifically say they work on XP.)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!