C++ simple OpenGL, WinXP support?


I want to write (and learn) a simple-as-possible OpenGL program, using the latest version of OpenGL that is fully supported by WinXP.

As far as DirectX goes, I think DirectX 9.0c is the latest version that WinXP can use.

But, as far as OpenGL goes, I have no idea. Also, I have no idea which libraries I should be using and including. There's opengl, gl, glu, glut, freeglut, glew, glfw, and maybe more, with many versions.

I don't know which things/libraries I should even be using, or, which ones are too new for WinXP, or too ancient (even for WinXP).

Can anyone give me some guidance?

The program just needs to render 3D shapes with textures, and the ability to move around with user input. :)

(Additionally, if anyone knows any tutorials that are tailored to these includes/versions, I would also be very grateful.)

Thank you so much.
Last edited on
For tutorial, the great one is the arcsynth one, at http://www.arcsynthesis.org/gltut/. Anyway, Windows only natively supports OpenGL 1.1, so you will need to directly import the higher level functions directly, which can get complicated.

My recommendation is to use the "Unofficial" OpenGL SDK, which provides a bunch of useful utilities to do basic OpenGL, as well as providing a utility called glLoad, which does the complicated process of loading all the OpenGL files and declaring them for usage. Otherwise, GLEW is a library to help simplify this loading of extensions, which can be used instead. Read the manuals to see how each one works. Hope this helps!

EDIT: Fixed tutorial link

EDIT: Just so you know what each of what you have mentioned are:

OpenGL: The graphics rendering standard and API
GL: The header that is included to do basic pre-3.0 rendering
GLU: The OpenGL Utility Librariy: Deprecated, used to simplify tasks used in pre-3.0 rendering
GLUT: The OpenGL Utility Toolkit: A cross platform windowing system to create a quick and easy window. Most useful for demos, its also very old.
FreeGLUT: A modified, up-to-date version of GLUT.
GLEW: The GL Extension Wrangler, used to use modern OpenGL (i.e. 3.0+)
GLFW: Another windowing system, designed with games in mind.
Last edited on
Well, my initial concern was that I am including either too many libs (overhead which I am not using), or libs that are too new for WinXP (possibly wasteful again if it includes functionality too advanced), or libs that are too ancient for WinXP (wasteful again, if I am including the overhead of outdated functions (even for WinXP) that I shouldn't use anymore)

The OpenGL SDK seems to package them all together which is sort of what I was trying to avoid.

Am I not understanding something?

Thank you for the descriptions of what each does, that does help.

I'm pretty sure I should have freeglut, because (looking at your link), it has window-making code, input, and rendering. Is that all I'd need, then, for a program that renders 3D shapes with user input? But usually whenever I find a tutorial that uses freeglut, they also include gl/glu or something as well.. ????
You will need a few libraries to just get a window up if you want simplicity. I would recommend starting with pre 3.0 OpenGL combined with GLUT or a substitute for GLUT. It is simple, and easy to learn and get started with. It's great for small experiments to introduce yourself to the world of 3D and graphics programming.
Just to differ on opinion here: I would recommend NOT learning pre-3.0 OpenGL at all, because the way to draw shapes (i.e. the fixed routine glBegin / glEnd functions) are completely different to the newer versions, and all it will do is get you confused.

If you want the minimum number of libraries, you will want (assuming freeGLUT):
FreeGLUT for the window
GLEW for the graphics, assuming that you want to be able to support 3.0.

GL and GLU are used for the old style graphics, which is completely outdated nowadays. Also, XP hasn't really been that far outdated, the only parts that would stop this working would be the graphics drivers that you have installed. You will definitely need to update them, though.
Thank you sirs for the thorough information!

So to recap: gl/glu are fixed function pipeline pre-3.0 rendering (*too* outdated) but freeglut and glew will give me the things I need but still work on an up-to-date(as possible) WinXP machine.

If everything I've said seems correct, thank you -- I'll check out freeglut/glew and get to work. If I've said something incorrect, please by all means correct me. Thanks again :)
Am I not understanding something?

Yes, mainly that when a program is compiled most compilers will optimize the code and throw out any parts that were included in the object file but never used. Even if it does not throw out this excess code you will not notice the micro second of load time it adds to your process or the extra page or three of memory that it might occupy. Memory is cheap and abundant in modern systems and should only be a concern when you are about to run out of it. Until then as long as you are managing your dynamic allocations properly then you're already doing better then 90% of the commercial software on the market today.

Is that all I'd need, then, for a program that renders 3D shapes with user input?

No, OpenGL does not handle user input or Window management. GLEW or GLUT create windows. But I can't remember for certain if either of them handle user input, I know that OpenGL does not. I usually use SFML for this since it's easy and I have a lot of experience with it.
Topic archived. No new replies allowed.