Jump to content
  • Advertisement
Sign in to follow this  
sandblasted

header files ???

This topic is 3012 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

Hi guys , I am new to openGL coding. I am really confused bout the different header files that i need to include in the code body. like the following header files #include <gl\gl.h> #include <gl\glu.h> #include <gl\glaux.h> #include <gl\glut.h> What do they mean. I mean I dont even know which one to use when. I am using glut applications in my codeblocks IDE. For my first code (first example from redbook, which just displayed a rectangle) I used <gl/glut.h> and <windows.h> and it worked fine. But I used these header files out of guessing. When are the <gl\gl.h> or <gl\glaux.h> or <gl\glu.h> are used? And why is a backslash ("\") used between <gl\glut.h>. why cant I use simply write <glut.h>? Someone please explain in easy words. I am pretty confused and scared about the whole openGL stuff. thanks.

Share this post


Link to post
Share on other sites
Advertisement
Gl\Gl.h is for default OpenGL Functions like glVertex3f, glBegin...
Gl\GLU.h is for GLU library functions like gluPerspective,...
GL\GLUT.h is for GLUT library functions like glutInit,...

if you see you need the functions with the following prefixes then include the header, otherwise its not needed.

Quote:
And why is a backslash ("\") used between <gl\glut.h>. why cant I use simply write <glut.h>?


because they are included in directory like that (just example):

for example: "C:\Program Files\OpenGL\include" is included by the compiler and inside this directory there is a directory "C:\Program Files\OpenGL\include\GL". That's why you <GL\GL.h> (where tags show that its a compiler include)

Share this post


Link to post
Share on other sites
Quote:
Original post by sandblasted
When are the <gl\gl.h> or <gl\glaux.h> or <gl\glu.h> are used?


When you need the things that they contain. Each one provides different stuff related to GL.

It tells you in the red book what each of them provides. If you don't understand how it's written there, you probably need to learn more about programming in general before you are really ready to do things with OpenGL.

Quote:
And why is a backslash ("\") used between <gl\glut.h>. why cant I use simply write <glut.h>?


Because you are providing file names for the header files, and those header files are in a sub-folder of where all the header files are kept.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!