Write old opengl or new OpenGL?

Started by
13 comments, last by FGFS 10 years, 6 months ago

Hi everyone. I am new to OpenGL and also to this forum.

I wanted to know which are the benefits of using the newest specifications of OpenGL. Is it not better to use the older versions so more computers are able to run my game?

I ask this because I have been reading this online book Learning Modern 3D Graphics Programming and it uses newer version of OpenGL than mine and I can not even compile the examples.

Thanks in advance.

Advertisement

You can still use GL 2.1 and not use the deprecated functionality. Ie, use your own/3rd party math/matrix lib... Use VAO/VBO shaders, etc.

The benefit to using modern OpenGL is that it will work on most computers (phones, tablets etc), whereas the decades-old version won't.

Stephen M. Webb
Professional Free Software Developer

The benefit to using modern OpenGL is that it will work on most computers (phones, tablets etc), whereas the decades-old version won't.

Oh, really? I didn't know that, in fact, I thought it was the other way around(that older versions where more portable).

Then I wonder why I culdn't compile the examples of the book I said.

I get this error message:


tut1.cpp:10:32: error fatal: glload/gl_3_2_comp.h: No existe el archivo o el directorio

Which means that the file or folder doesn't exist.

Thanks for the answer!

You're getting errors because you probably don't have your development environment set up correctly.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

I don't use any IDE I use g++ under ubuntu 13.

The version of OpenGL is 2.1.

Thanks!

I'd guess modern OpenGL is far better - in terms of both, support and writing in it.

Anyways having OpenGL 2.1 seems like you're having either old integrated GPU, or something is terribly wrong with your graphics drivers.Can you tell us what GPU/drivers do you use?

My current blog on programming, linux and stuff - http://gameprogrammerdiary.blogspot.com

I don't use any IDE I use g++ under ubuntu 13.

The version of OpenGL is 2.1.

Thanks!

It doesn't have to be an IDE; if the path to the gl headers isn't set up correctly in your environment variables or makefile you'll still get a similar error.

Note that here we're talking about a pure software concept - compiling code - and that has absolutely nothing whatsoever to do with which version of OpenGL your hardware supports (and always remember that OpenGL is not software). It's possible to compile OpenGL 4.4 code on hardware that only supports 1.1, and vice-versa.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

I don't use any IDE I use g++ under ubuntu 13.
The version of OpenGL is 2.1.
Thanks!

If you're seeing OpenGL 2.1 on Ubuntu 13.04 or 13.10 it's because you're looking at the Mesa drivers. Turns out they lie, they actually secretly support at least GLX+OpenGL 4.1 and EGL+OpenGL|ES 1.3. Of course, the runtime is provided by the DRI2 drivers for your hardware even if you compile against Mesa.

You might enjoy knowing that the Ubuntu Unity stack (the desktop shell) is built on those same Mesa bindings, using only OpenGL 2.1.4 with extensions (vertex and fragment shaders and VBOs and some texture extensions) or OpenGL|ES 2.1.4. That's the sweet spot for portability. Older than that, it won't work on mobile hardware and newer than that it won't work on netbooks and old machines.

For full portability, what you really want to do is use an extension wrangler, like Glew.

Stephen M. Webb
Professional Free Software Developer

Then I wonder why I culdn't compile the examples of the book I said.

I get this error message:

That error message implies you have not installed the prerequisite libraries as described in the "Building the Tutorials" chapter of that book. The SDK required for the tutorials should contain the file glload/gl_3_2_comp.h.

Stephen M. Webb
Professional Free Software Developer

This topic is closed to new replies.

Advertisement