You are on page 1of 3

4/7/24, 4:25 PM What OpenGL version to choose for cross-platform desktop application - Stack Overflow

What OpenGL version to choose for cross-platform desktop


application
Asked 13 years ago Modified 10 years ago Viewed 3k times

I'm working on some cross-platform desktop application with heavy 2-D graphics. I use OpenGL 2.0
specification because I need vertex shaders. I like 3.2+ core API because of it's simplicity and power. I
7 think that 3.2+ core could be a choice for the future. But I'm afraid that nowadays this functionality may
not be available on some platforms (I mean old graphic cards and lack (?) of modern Linux drivers).
Maybe, I should use OpenGL ES 2.0 -like API for easy future porting.

What's the state of affairs with 3.2+ core, cards and linux driveres?

opengl opengl-es opengl-es-2.0 opengl-3

Share Improve this question Follow asked Mar 31, 2011 at 11:50
Yury
3,108 2 25 24

5 Answers Sorted by: Highest score (default)

Older Intel chips only support OpenGL 1.5. The later chips (since about two years ago) have 2.1 but that
performs worse than 1.5. Sandy Bridge claims to support "OpenGL 3" without specifying whether it is
6 capable of doing 3.3 (as Damon suggests) but Linux drivers only do 2.1 for now. All remotely recent
Radeons and Nvidia hardware with closed-source drivers support 3.3 (geometry shaders) and the 400-
500 series support 4.1 (tesselation shaders).

Therefore, the versions you want to aim for are 1.5 (if you care about pre-Sandy-Bridge Intel crap), 2.1
(for pretty much all hardware), 3.3 (for decent hardware & closed-source drivers) or 4.1 (bleeding edge).

I have vertex and fragment shaders written with #version 120 and geometry shaders written in #version
330, to make fallback on old hardware easier.

Share Improve this answer Follow answered Jun 15, 2011 at 10:09
Tronic
10.3k 2 43 53

Several days ago I had problem with Intel chips and OpenGL 2.1 . Probably, it'd be better to conform 1.5, but
shaders sometimes are really indispensable. – Yury Jun 16, 2011 at 6:17

I don't use Apple products myself, but one thing to add: OS X still doesn't appear to support anything better than
OpenGL 2.1 :O – Tronic Jun 16, 2011 at 8:55

You can stay on OpenGL ES 2.0. Even if ES mean Embed, it's a good approach because it remove all
the fixed functions (glBegin, etc...): you are using a subset of OpenGL 2.x. So if you write your software
6 by thinking only OpenGL ES 2.0, it will be fast and work on the majority.

https://stackoverflow.com/questions/5499351/what-opengl-version-to-choose-for-cross-platform-desktop-application?rq=3 1/3
4/7/24, 4:25 PM What OpenGL version to choose for cross-platform desktop application - Stack Overflow

In real, OpenGL ES 2.0 and desktop GL might have some difference, but i don't think it will be something
you will use. If the extension GL_ARB_ES2_compatibility is supported, you have a "desktop" card that
support the complete embed subset. (4 func and some const.)

Now, the real question is how many years of hardware do you want to support ? They are still lot of very
old hardware that have very poor gl support. Best would be to support the less-old (OpenGL 2.0 is
already old) :)

Share Improve this answer Follow edited Mar 22, 2014 at 14:18 answered Jun 15, 2011 at 22:03
eonil tito
84.8k 83 327 521 13.1k 1 56 75

+1 ES 2.0 seems to be a great combination of features (fully programmable and removes all legacy features) and
widespread compatibility. – Justin Meiners Jun 18, 2016 at 19:14

I would personally go for OpenGL 3.3, optionally with a fallback for 3.2 plus extensions (which is
basically the same). It is the most convenient way of using OpenGL 3.x, and widely supported.
2
Targetting 3.1 or 3.0 is not really worth it any more, except if you really want to run on sandy bridge
(which, for some obscure reason only supports 3.0 although the hardware is very well capable of doing
3.3). Also 3.1 and 3.0 have very considerable changes in shader code, which in my opinion are a
maintenance nightmare if you want to support many versions (no such problem with 3.2 and 3.3).

Every hardware that supports 3.2 can also support 3.3, the only hindrance may be that IHVs don't
provide a recent driver or a user may be too lazy to update. Therefore you cannot assume "3.3 works
everywhere". The older drivers will usually have the same functionality via ARB extensions anyway,
though.

Share Improve this answer Follow answered Mar 31, 2011 at 12:23
Damon
68.8k 20 139 186

Mac OS X doesn't support GL-3 context at the moment. This summer may change the situation, but I
would recommend to stick with GL-2 plus extensions nevertheless.
1
Share Improve this answer Follow answered Mar 31, 2011 at 13:29
kvark
5,311 2 25 33

https://stackoverflow.com/questions/5499351/what-opengl-version-to-choose-for-cross-platform-desktop-application?rq=3 2/3
4/7/24, 4:25 PM What OpenGL version to choose for cross-platform desktop application - Stack Overflow

Depends on your target market's average machine. Although to be honest, OpenGL 3.2+ is pretty
ubiquitous these days.
0
Share Improve this answer Follow answered Mar 31, 2011 at 11:54
cmannett85
22k 8 79 125

https://stackoverflow.com/questions/5499351/what-opengl-version-to-choose-for-cross-platform-desktop-application?rq=3 3/3

You might also like