Jump to content

  • Log In with Google      Sign In   
  • Create Account


Write old opengl or new OpenGL?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
14 replies to this topic

#1 tuket   Members   -  Reputation: 109

Like
0Likes
Like

Posted 25 September 2013 - 03:17 PM

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.



Sponsor:

#2 3TATUK2   Members   -  Reputation: 729

Like
1Likes
Like

Posted 25 September 2013 - 03:33 PM

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.



#3 Bregma   Crossbones+   -  Reputation: 4873

Like
1Likes
Like

Posted 25 September 2013 - 03:47 PM

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

#4 tuket   Members   -  Reputation: 109

Like
0Likes
Like

Posted 25 September 2013 - 04:09 PM

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!



#5 mhagain   Crossbones+   -  Reputation: 7671

Like
2Likes
Like

Posted 25 September 2013 - 04:43 PM

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


It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.


#6 tuket   Members   -  Reputation: 109

Like
0Likes
Like

Posted 25 September 2013 - 05:42 PM

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

The version of OpenGL is 2.1.

Thanks!



#7 Vilem Otte   Crossbones+   -  Reputation: 1376

Like
0Likes
Like

Posted 25 September 2013 - 05:51 PM

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


#8 mhagain   Crossbones+   -  Reputation: 7671

Like
0Likes
Like

Posted 25 September 2013 - 06:05 PM

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.


It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.


#9 Bregma   Crossbones+   -  Reputation: 4873

Like
1Likes
Like

Posted 25 September 2013 - 09:05 PM

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

#10 Bregma   Crossbones+   -  Reputation: 4873

Like
0Likes
Like

Posted 25 September 2013 - 09:12 PM

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

#11 Vilem Otte   Crossbones+   -  Reputation: 1376

Like
0Likes
Like

Posted 26 September 2013 - 02:05 AM

#Bregma - actually Mesa doesn't support full OpenGL 4 features yet, they are work in progress.They allow OpenGL 3.1 level feature set in release 9.2, although I know that even some OpenGL 4.x level extension are implemented.

 

The problem is, Ubuntu is using old version in their packages.


Edited by Vilem Otte, 26 September 2013 - 02:06 AM.

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


#12 tuket   Members   -  Reputation: 109

Like
0Likes
Like

Posted 26 September 2013 - 02:57 AM

Do you mean that the code is portable no mather the version you are using? Can I compile one code and choose the target OpelGL specification? 

Thanks for the replies!



#13 Bregma   Crossbones+   -  Reputation: 4873

Like
0Likes
Like

Posted 26 September 2013 - 09:37 PM


The problem is, Ubuntu is using old version in their packages.

We ship Mesa 9.2, released August 27, 2013, in Ubuntu "Saucy Salamander".  That doesn't seem all that old to me, considering it's the latest version released.  Of course, you might be using an older release of Ubuntu, which consists of older packages.

 

But I stand corrected, Mesa supports only OpenGL 3.1 (and OpenGL|ES 3).


Stephen M. Webb
Professional Free Software Developer

#14 Karsten_   Members   -  Reputation: 1560

Like
0Likes
Like

Posted 02 October 2013 - 03:51 PM

My laptop has an Intel GMA 965 which on FreeBSD glxinfo reports version 2.0 and on OpenBSD it reports 2.1 (I guess OpenBSD is ahead of FreeBSD for graphics drivers for some reason) :/

Regardless I find using glew with 2.1 pretty ideal. There are not really any major restrictions to be encountered smile.png
An interesting test to sanity check my OpenGL code is using Emscripten and outputting to a web browser which only supports OpenGL ES 2.0 and is pretty strict.

However, I am really curious about the OpenGL SC 1.3 standard (http://www.khronos.org/openglsc). Is this possible on consumer hardware? In which case we can no longer call OpenGL 1.3 "legacy" ;)

Mutiny - Open-source C++ Unity re-implementation.
Defile of Eden 2 - FreeBSD and OpenBSD binaries of our latest game.


#15 FGFS   Members   -  Reputation: 193

Like
0Likes
Like

Posted 02 October 2013 - 11:34 PM

My Asus/Nvidia GTX 770 on Ubuntu 13.04 64bit says to use OpenGL 4.3.

 

Hence use that? Not sure if it's possible to use those headers though. I also

think that any mobile devices don't support OpenGL 3 or even 4. Probably

targeting 2.2 would make sense while keeping an eye on opengles?


Edited by FGFS, 03 October 2013 - 11:49 PM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS