Starting to program with OpenGL.

Hey,
I would like to start programming with OpenGL. I have C++ experience. I was wondering, where can i download the OpenGL developer stuff? I’ve searched this site, but no luck. Or do i have to buy it?
Please help.
Cheers.

No need to pay to program with OpenGL API.

See the coding FAQ :
http://www.opengl.org/resources/faq/getting_started.html

Ok thanks.
I’ve downloaded some SDK which contained a few header files. But not some file required for opengl, windows.h.
Could anyone please tell me where to get this file?
Cheers, Sentinel

Hi !

You will need at compiler to compile your OpenGL code, like Visual Studio or MinGW32 or something like that, those compilers comes with all files you need to compile OpenGL code.

Visual Studio is available as a free console only download I belive at msdn.microsoft.com, or you could use gcc (www.mingw.org).

There are of course other alternatives also like Borland, Watcom, LCC and so on.

Mikael

Yeah i have a compiler, (two actually) but it hasn’t got windows.h.

I have found windows.h, thanks to all that helped.

But now i have other problems, it seems that almost every program requires header files that i DON’T have, so if anyone could point me directly to a valid OpenGL library, that would be most helpfull, i now got a few header files from a package i got from sgi.com.
Please help me.

windows.h is a include file for “Microsoft Windows”.
Since your compiler(s) dont have it, I assume we arent talking about a MS Windows environment.

As said before, the compilers should come with everything you need. If they dont then it dosent help to randomly download stuff that is not meant for your environment (whatever that may be).

So what compiler(s) and os are we talking about?

I did some search and the compiler did include it. I’m using Digital Mars for my library stuff and Dev-C++ for compiling.
I just need a valid OGL package. Someone please point me to one. I can’t seem to find a package with all the files the tutorials and programs are talking about.

Getting programs to compile involves making sure headers are found at compile time and that libs are found at link and probably run time.

You will have the required headers especially if you have installed an SDK from here or from NVIDIA or ATI. Same with the libraries. You need to find the headers and either add the path to your project or move the libs to an existing path.

Once you find the headers your compiler will probably start asking for missing libs or complaining about unresolved symbols during link time and you will have to add the link path or move the files locally or to an appropriate system directory. This is basic compilation stuff. You should probably get a book on OpenGL development if you can’t get this working soon. Pretty much any of the OS specific books will help you with this.

I know what to do with the headers once i have them, but my problem is, i don’t have them. :frowning:
Could anyone point me to a valid package of OpenGL header files? It would be most apreciated. :frowning:
Cheers.

Did you actually read the link I posted ?

Which header files do you need ?

Yes i read it and i used the information. I downloaded a package with header files, but unfortunately very few header files.
I’ve seen header files like glaux.h and glu.h in tuts, but they are not in my package :frowning: . So if anyone could point me directly to a complete package that’ll be most helpfull.
Cheers.

That is right, GLU can not be downloaded from that page, despite there is a link that says “you may need include files and libraries for GLU and GLUT.”
http://www.opengl.org/documentation/spec.html/

And there is only gl.h related files ???

A webmaster could fix this ???

Very often, glu.h comes with the compiler. Anyway :
http://freedesktop.org/cgi-bin/viewcvs.cgi/checkout/mesa/Mesa/include/GL/glu.h

About glaux.h : very old lib. Try to find tutorials for glut instead, you can find Glut versions for most tutorials at http://nehe.gamedev.net

Ahhh ok so you use the Bloodshed Dev C++ compiler.

I think you will find this webpage very usefull:

http://www.angelfire.com/linux/nexusone/dev4.html

A quote from that page:

“Note all files needed to compile with openGL are shipped with DEV-C++”

Hope that helps.

You mentioned you downloaded an SDK but perhaps not one I was hoping. Both NVIDIA and ATI have SDKs available for download that will provide the correct libs. You can also get glut online if they don’t provide that.

glaux is dead, get some better examples to compile, most glaux examples have been ported to glut, even the ones in early revisions of the red book. glu.h is legit and will be in any OpenGL SDK from any manufacturer (looks like opengl.org is missing it !?). glut is popular and can be found online easily if it doesn’t ship with your chosen SDK.

http://www.opengl.org/resources/libraries/glut.html

Dorbie he said he uses the bloodsheed Dev C++ compiler, Nvidia’s and ATI’s SDK are meant for the MS VS so he will have trouble getting them to work because Dev C++ uses a different .lib format.

As I said, Dev C++ comes with the OpenGL/GLUT/GLAUX libs and headers, he should have everything he needs.

Ok i see Dev-Cpp should come with glut.h, glaux, glu.h, glext.h and gl.h.
There’s another problem, mine has only glu.h, glext.h and gl.h.
I’ve read all the links you guys provided, but still no luck… :frowning:
Please point me directly to a package with them…
Or to a better Dev-C++ version…
Cheers.

DEV-C++ V4.0

http://ftp1.sourceforge.net/dev-cpp/devcpp4.zip

Content of include/gl

gl.h
glaux.h
glut.h
readme.txt (with a description)

Content of lib (among others)

libglaux.a
libopengl32.a
libglut32.a

Hmm. I’ve done everything like it should be done now. I’ve placed the header files in the good directory, correct library’s everywhere. But still the compiler refuses to work…
I’ve tried all the versions of Dev-C++ about now :stuck_out_tongue:
And i seem to need MSVC++ for NeHe’s tuts.
Could someone point me directly to the proper version of MSVC++ used in NeHe’s tuts… All i seem to find are updates.
Cheers.

Nehe’s tuts ?
Just download the right package :
“DOWNLOAD Dev C++ Code For This Lesson.”
http://nehe.gamedev.net/data/lessons/devc/lesson01.zip

No offence, but if you are unable to read, I am afraid you will have hard time programming in OpenGL (or whatever).