Jump to content

  • Log In with Google      Sign In   
  • Create Account


C++ OpenGL - Deprecated or not !


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
17 replies to this topic

#1 aliasc   Members   -  Reputation: 180

Like
1Likes
Like

Posted 02 March 2014 - 07:22 PM

First of all i dont really understand all these updates and modern OpenGL. I was studying OpenGL in college and we used old deprecated stuff. After some time i come back to it and i see lot of changes. I've seen glfw glew but not used them and im really confused what is what and what to start learning.  Also, since i dont plan on using fancy shaders on my programs can i continue with plain old OpenGL ?



Sponsor:

#2 ryutenchi   Members   -  Reputation: 353

Like
5Likes
Like

Posted 02 March 2014 - 08:35 PM

OpenGL 3.0 introduced what's called the "Core profile" that deprecates all of the fixed-pipeline functionality and state tracking. Some platforms require the use of it in order to use the "modern" OpenGL functionality like geometry shaders, etc. That said you can us the "Compatibility profile" and it's like nothing ever happened.^^

 

I would suggest learning the "modern" methods as they allow for so much more freedom and will let you play with the new hotness should you be ever be so inclined!^^ (Not to mention MUCH more performant)

 

http://www.arcsynthesis.org/gltut/

http://www.opengl-tutorial.org/

 

Those may help^^


Edited by ryutenchi, 02 March 2014 - 10:26 PM.


#3 Petrov_VA   Members   -  Reputation: 592

Like
0Likes
Like

Posted 02 March 2014 - 09:03 PM

Adaptation of the codes of 2000 to Visual C++ MS VS pro 2010-2012:   NeHe's demo and codes OpenGL summary 



#4 TheChubu   Crossbones+   -  Reputation: 3992

Like
3Likes
Like

Posted 02 March 2014 - 09:17 PM

AlS4tSp.jpg

 

More seriously, if you are interested in 3D, learn "modern" OpenGL. There is no point in fixed function pipeline if you want to delve further into computer graphics. That arcsynthesis online book that ryutenchi linked is a nice start.

 

Now if you just want to draw things to the screen, you might be better off with a graphics library that can do that for you so you don't have to mess with OpenGL client states and the stupid stack-like interface (which is cumbersome and grants you a grand amount of 0 useful knowledge to you).


"I AM ZE EMPRAH OPENGL 3.3 THE CORE, I DEMAND FROM THEE ZE SHADERZ AND MATRIXEZ"

 

My journals: dustArtemis ECS framework and Making a Terrain Generator


#5 tanzanite7   Members   -  Reputation: 1204

Like
0Likes
Like

Posted 03 March 2014 - 05:19 AM

I've seen glfw glew but not used them and im really confused what is what and what to start learning.

 

Thous are not OpenGL, per-se, they are there just to help you with some of the mundane tasks related to opengl. Most importantly - a crap-ton of boilerplate code to expose all the available/requested functions/enums for you.
 

Just read a bit about them and pick one you like - knowing that it is fairly easy to change your mind later on.

 

Also, there is a bit of truth in saying that the OGL3.3+ way (without backwards compatibility) is easier to work with than the old ways even when you do not need any of the new features - although the entry fee, if i may say so, is a bit higher. The mentioned http://www.arcsynthesis.org/gltut/ is great help there (at least read the "About this Book" part to know what you get yourself into).



#6 samoth   Crossbones+   -  Reputation: 4661

Like
2Likes
Like

Posted 03 March 2014 - 06:51 AM

Although at least one very major person from one very major manufacturer disagrees with my opinon, I suggest not using deprecated functionality. The reason is that as a beginner, it is not immediately obvious for you which deprecated functionality is well-supported in hardware and what isn't. On the other hand, once you have climbed over the -- admittedly high --  entry barrier (like, having to type 100 lines of code to produce the first triangle), core functionality isn't any harder than using deprecated features.

 

Also despite vendors currently promising not to do this any time soon, one day the deprecated functionality will be removed. Nor can you rely that while maybe one or two vendors will keep supporting deprecated functionality, in fact all of them will.

 

Indeed, I would wish for manufacturers to drop deprecated functionality in favor of making core functionality better and faster, and making drivers smaller, less complicated, and bug-free.

 

 

For the record, here is what Mark Kilgard has to say about it:

 

OpenGL 3.1 introduced notion of “core” profile

 

Idea was remove stuff from core to make OpenGL “good-er”

  • Well-intentioned perhaps but...
  • Throws API backward
  • compatibility out the window

Lots of useful functionality got removed that is in fast hardware

  • Examples: Polygon mode, line width

Lots of easy-to-use, effective API got labeled deprecated

  • Immediate mode
  • Display lists

Best advice for real developers

  • Simply use the “compatibility” profile
  • Easiest course of action

Requesting the core profile requires special context creation gymnastics

  • Avoids the frustration of “they decided to remove what??”
  • Allows you to use existing OpenGL libraries and code easily

•No, your program won’t go faster for using the “core” profile

  • It may go slower because of extra “is this allowed to work?” checks

 

Nothing changes with OpenGL 4.3 NVIDIA still committed to compatibility without compromise

 

Source: GTC 2010 session, OpenGL Version 4.3 is here



#7 fir   Members   -  Reputation: -448

Like
-6Likes
Like

Posted 03 March 2014 - 07:08 AM

Imo todays opengl is 'overstuffed' for small 'indie' games, 

It is good for big comercial games (like for example "nail'd"

game i play recent whole week) with heavy heavy tons

of geometry and coloring - but much heavy for small fckn*  indie

games



#8 samoth   Crossbones+   -  Reputation: 4661

Like
3Likes
Like

Posted 03 March 2014 - 07:53 AM

Imo todays opengl is 'overstuffed' for small 'indie' games, 

It is good for big comercial games (like for example "nail'd"

game i play recent whole week) with heavy heavy tons

of geometry and coloring - but much heavy for small fckn*  indie

games

I don't know... while OpenGL 3.x or 4.x is a real pain to get working at all, it is actually a lot easier than the old versions... once you're over that initial hurdle.

 

There are no obscure limits, and the limits that do exist are so big that you will likely never run into them (unless you write something like FarCry 3). There is, at least in theory, no struggling about what special feature that you need a particular graphics card supports and doesn't support, and which extension you need to load, and what fallback strategy if that doesn't work. Because, behold, everything that you reasonably need just works.

 

Also, even indie games nowadays have much higher geometry demands (think Minecraft) than immediate mode can reasonably deliver. Sure, it won't make much of a difference if you write a side scroller like Flappy Birds, which is basically a dozen textured quads. But it makes a huge difference for everything else.

Even for quite "simple" 2D games which "only" draw a few hundred tiles or textured quads (think "diamonds" or "frozen bubble" or a graphical roguelike or dwarf-fortress-alike), instancing and array textures may be big win both for performance and ease of implementation.


Edited by samoth, 03 March 2014 - 07:56 AM.


#9 SeanMiddleditch   Members   -  Reputation: 4878

Like
0Likes
Like

Posted 03 March 2014 - 09:48 AM

My recommendation continues to be to learn Direct3D 11 first. The debugging tools for Direct3D are years ahead of those for OpenGL. The drivers are more stable and less buggy. The API more closely matches how actual hardware works. There's no deprecated features as each version of the API simply removes old stuff. All of this amounts to Direct3D 11 being a significantly better _learning_ platform, independent of your opinions of Microsoft/Windows and alternative OSes or technologies. The Direct3D API is cleaner and has far less odd historic baggage to trip you up.

The knowledge and understanding of graphics development you acquire with Direct3D ports fairly well over to OpenGL.

Starting with OpenGL has many problems. First there's all that deprecated API baggage, and it's all too easy to end up using some old API for something without realizing it (or realizing _why_ it's deprecated, since it still works and the problems are not immediately obvious). The documentation on OpenGL is almost universally out-dated and even newer documentation is often written by people falling into the same deprecated API trap. The drivers tend to be buggier and you (and all your users) have to be updated to the very latest version to avoid major bugs in new API features. The API does not directly or obviously map to hardware and so you don't tend to learn everything you should know as a graphics programmer (you need to know way more than just what function in the API does what). Drivers tend not to support the latest version of GL very quickly; AMD still doesn't support 4.4 and Intel is still stuck on 4.0 I believe, while both support Direct3D 11. There are bits of GL that D3D doesn't support (that tend not to be all that important), but there are major chunks of Direct3D that OpenGL takes years to catch up to and then even longer for the driver vendors to support (as in GL 4.4). The debugging tools for OpenGL are lacking in features compared to their D3D equivalents, often lack support for the latest versions of GL, and tend to be buggy themselves.

Start with Direct3D 11. Learn how to graphics. _Then_ worry about portability and the maze of OpenGL APIs/versions.

#10 Bregma   Crossbones+   -  Reputation: 4869

Like
3Likes
Like

Posted 03 March 2014 - 10:33 AM

Also, keep in mind the majority of computers out there do not support the old OpenGL with its fixed pipeline.  Most of them support only OpenGL|ES.  Learning the deprecated parts of OpenGL today is like learning COBOL in the 1980s (substitute creaky old legacy desktop computers with mainframes, too).  Somebody has to support the legacy stuff that's going to be around for a while yet, but if you want a job writing the disposable code that's the way into the future, stick to the subset of GL that's in GL|ES 2 and you won't go wrong.

 

There are still jobs for mainframe COBOL programmers.


Stephen M. Webb
Professional Free Software Developer

#11 frob   Moderators   -  Reputation: 19862

Like
3Likes
Like

Posted 03 March 2014 - 10:49 AM

This quickly devolves back to the old OpenGL vs Direct3D debate.

The two have different philosophies, both with their own benefits and drawbacks.

Direct3D packages features together in one era-specific bundle. Either the bundle is fully available on the machine or it is completely unavailable. Once you select the bundle you cannot move outside it. While this is great for performance generally and solves several device-specific compatibility concerns, it makes experimentation and addition of new features much more difficult.

OpenGL provides access to everything the hardware says it can do. The oldest, slowest, most unoptimized methods are available to you, as are the most cutting edge experimental features the driver provides. While it makes it very easy for you accidentally use poor performing features and means you sometimes need to be aware of platform-specific differences, it makes experimentation and addition of new features very easy.


Both solutions are valuable, depending on your project's specific needs.
Check out my personal indie blog at bryanwagstaff.com.

#12 Karsten_   Members   -  Reputation: 1560

Like
0Likes
Like

Posted 03 March 2014 - 11:01 AM

At the hobby level, using either technology isn't all that many lines of code different so perhaps implement both ;)

 

I do find it a bit annoying that the semi-official DXUT has been demoted from the official Microsoft SDK. I used to teach students with that and like GLUT, I found it was a great way to skip the WinAPI / X11 cruft.

 

As for legacy OpenGL stuff.. who cares?, just dont use it (even on a platform that can). I find the biggest problem are all the obsolete tutorials laying around the internet. Perhaps the next OpenGL standard should be renamed KarstenGL_ to help find more directed / useful sites on the internet ;)


Edited by Karsten_, 03 March 2014 - 11:02 AM.

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


#13 aliasc   Members   -  Reputation: 180

Like
0Likes
Like

Posted 03 March 2014 - 02:02 PM

Well thanks for all of the replies, for which i partially understood what u guys said. Some suggest switching to Direct3D, some talking about stuff i don't even have idea what it is, since im in learning steps. I like how glfw handles windows in itself but what when it comes to audio and networking ? Direct3D seems to be more complete and i dont know why OpenGL guys are not making such complete changes but rather just updating the core. I'm tired of all those changes and deprecated stuff, libraries and whatsoever. I'm thinking of switching to Direct3D and learn something complete that is worth giving my time. Also if they decide to remove deprecated stuff from the core what will happen to old games that were developed with old OpenGL. Really im tired of all this stuff which makes it more harder for beginners to understand what is what and what to start learning.



#14 frob   Moderators   -  Reputation: 19862

Like
1Likes
Like

Posted 03 March 2014 - 03:23 PM


Direct3D seems to be more complete and i dont know why OpenGL guys are not making such complete changes but rather just updating the core.

As mentioned in my post above, that is the choices the two teams have made.

 

Direct3D is focused around a bundle of features. If you create a Direct3D 6 interface it means you get everything from the 1998 era. Everything is designed around high performance graphics concepts at that time. If you create a Direct3D 9 interface it means you get everything from the 2002 era. Everything is designed around the high performance graphics concepts at that time. If you create a Direct3D 11.2 interface it means you get everything from last year's batch of high performance graphics concepts.

 

You might be thinking "Great, I'll just create an 11.2 interface and work with the modern stuff!"  But it isn't that simple. It means the simple immediate-style interfaces are unavailable to you, you must develop your code around high-volume polygonal systems. It means you cannot opt out of shaders, you are required to provide default compute shaders, pixel shaders, geometry shaders, and more even though you are just learning what those means. It means you cannot opt out of any part of the rather complex rendering pipeline.

 

When it comes to learning how to write graphics programs you might decide that you want to leap in head-first and hope you can swim. In that case, pick up the latest round of D3D that your system supports, provide all the mandatory shaders (As a beginner you are still responsible to know how to write shaders) then properly configure all the steps of rendering (you've studied all the stages, right?) then load your meshes and textures (you aren't allowed to draw primitives since it is focused on high performance rendering; even as a beginner you must use the same types of models the professionals use) then feed in all your animation arrays (which, as a beginning programmer, you may not be comfortable creating) and otherwise do all the required steps.

 

If you aren't comfortable taking on EVERYTHING that is required of the latest D3D edition, you can look back and take a simpler collection of interfaces. D3D9 is relatively popular because it still includes a lot of legacy material and doesn't require the programmer to provide everything along a fully-programmable pipeline. But you still need to provide quite a lot.

 

 

The OpenGL mentality is different.  The goal is not to provide a single unified interface. The goal is to provide an interface to all the functionality present on the card. You are permitted to use non-optimal functionality. If you are learning the basics of 3D mathematics you are not forced to provide a bunch of mandatory shaders. If you are learning the basics of 3D model management and manipulation, you are not forced to follow the high-performance methods of transferring them to the card and managing remote resources. You can pick and choose what features you want at any time.

 


Also if they decide to remove deprecated stuff from the core what will happen to old games that were developed with old OpenGL.
OpenGL code will continue to function as long as the cards and drivers are able to provide the features. Even if they are provided through slow software emulation, all that is required is that they are present.

 


Really im tired of all this stuff which makes it more harder for beginners to understand what is what and what to start learning.

Yes. You are not alone.

 

Twenty years ago when 3D graphics cards were just being introduced things were much easier.

 

Back then everyone was on a fairly level playing field.

 

Today you can start by looking at your comfort level, then deciding if you want to start learning a complete feature set (as provided by Direct3D) if you want to start learning one feature at a time (as provided by OpenGL). If you decide to learn a feature set, figure out what era of features you want to learn, and pick the corresponding set of features.

 

Used properly, both systems are fully capable of high-performance rendering required by modern games. Used improperly, both systems are fully capable of giving terrible performance. They are similarly powerful since they are basically just two alternate interfaces to the same underlying hardware.


Check out my personal indie blog at bryanwagstaff.com.

#15 SeanMiddleditch   Members   -  Reputation: 4878

Like
0Likes
Like

Posted 04 March 2014 - 01:17 PM

This notion about GL being easier because it can hide modern hardware features is a little off since Direct3D 11 can also be used in "easy mode" via Microsoft's official DirectX Tool Kit (https://directxtk.codeplex.com/). It supports a number of pre-configured effects and render states (so no messing with shaders or figuring out the magic combination to get alpha blending to work right), efficient immediate-mode-like primitive batching, texture loading, model rendering, sprite batching, sprite fonts, a math library, and some geometry/shape factories.

#16 tanzanite7   Members   -  Reputation: 1204

Like
0Likes
Like

Posted 05 March 2014 - 08:07 AM

This notion about GL being easier because it can hide modern hardware features is a little off since Direct3D 11 can also be used in "easy mode" via Microsoft's official DirectX Tool Kit ...

Full stop.

Don't compare unrelated things. OpenGL is only comparable to Direct3D - nothing else.

Also, I for one would appreciate if an extra effort would be made to evade "flammatory" corners of this topic. Might be just me though :/.

#17 tnovelli   Members   -  Reputation: 339

Like
1Likes
Like

Posted 05 March 2014 - 12:29 PM

There's one overwhelming reason to favor OpenGL over Direct3D: non-Windows platforms.

 

I would start with OpenGL ES 2 or 3. It's basically the modern subset of OpenGL. It opens the door to all kinds of mobile platforms, Raspberry Pi and such, and HTML5 WebGL (for whatever they're worth) in addition to desktop Linux, OSX, and Windows.

 

Disclosure: hardcore Linux user smile.png


Edited by tnovelli, 05 March 2014 - 12:29 PM.


#18 Karsten_   Members   -  Reputation: 1560

Like
0Likes
Like

Posted 05 March 2014 - 12:42 PM

There's one overwhelming reason to favor OpenGL over Direct3D: non-Windows platforms.

 

Definitely! Unfortunately many people still don't know what a Linux is.

Until Direct3D works on non-Microsoft platforms, it is still like comparing Apples and Oranges. As it stands, one works... one doesn't. Simple as that lol.

 

That said, the large number of ported DirectX games on the Linux version of Steam proves that migrating an existing codebase from Direct3D to OpenGL (and vise versa) isn't really that hard. Though unfortunately the recent death of Cg has complicated matters.

 

Disclosure: Equally hardcore BSD user smile.png


Edited by Karsten_, 05 March 2014 - 01:21 PM.

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





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