Which version of OpenGL is the most stable and currently used?

I was thinking of creating an extra shell for my project to use OpenGL, not Allegro. I was not sure which version of OpenGL to use, since I know that some computers cannot run the latest versions, such as v4.4. In addition, I need a version that does not compile any problems on Linux, Windows, Mac.

+4
source share
5 answers

You want to see which video cards will be available in your target systems and carry some details:

  • OpenGL up to 1.5 can be fully emulated in real-time software on most systems. You do not need hardware support for good performance.
  • OpenGL 1.4 has universal support. Almost all hardware supports it.
  • Mac OS X only supports up to OpenGL 2.0 and OpenGL 2.1 , depending on OS version and hardware. Systems using the GMA950 have only OGL1.4 support. Mac OS X Lion 10.7 supports the OpenGL 3.2 Core profile on supported hardware.
  • On Linux, this is not unusual for users who prefer open source drivers over alternative "binary blocks", so keep in mind that the version of Mesa that most people only support until OpenGL 2.1 compatibility. Upcoming versions support OpenGL 3.x. Closed binary drops usually support the highest version of OpenGL for hardware, including up to the OpenGL 4.2 kernel.

When considering what equipment is available to your users, Steam Hardware Inspection can help. Note that most users have DirectX 9 compatible hardware, which is roughly equivalent to OpenGL 2.0. The Wikipedia OpenGL article also indicates which hardware had initial support for which versions.

If you use a library, such as GLEW or GLEE, or any toolkit that depends on them or offers similar functionality (e.g. SFML or even Allegro with 4.3), then you do not have to worry about whether your code will compile. These tools take care of the details of including extensions and providing all the necessary symbols.

Given all this, I would suggest setting up OpenGL 2.1 to get the widest audience with the best feature support.

+7
source

Your safe bet is OpenGL 2.1, however it should be supported by the driver of your target system. OpenGL ES, used on several mobile platforms, is basically simplified by OpenGL 2, so even porting to them will be quite simple. I highly recommend using libGlew as VJo said.

+3
source

This applies less to operating systems and more about video card drivers.

I think 1.4 is the highest version that supports all consumer graphics systems: ATI (AMD), nVidia, and Intel IGP. Intel is certainly a limiting factor here, even when ATI or nVidia does not have hardware support, they release OpenGL 4.1 drivers that use software to emulate missing features. Not so with Intel.

+2
source

OpenGL is not a library that you usually compile and ship yourself (unless you are a Linux distribution and pack X.Org/Mesa). Your program simply dynamically links to libGL.so (Linux / BSD), opengl32.dll (Windows, on 64-bit systems, it also calls opengl32.dll, but it's actually a 64-bit DLL) or OpenGL Framework (MacOS X ), This gives your program access to install the OpenGL system. The version / profile you want to use does not affect the library you link!

Then after initializing your program, you can check which version of OpenGL is available. If you want to use OpenGL-3 or 4, you will have to shift a few additional hoops on Windows to make full use of them, but usually some kind of shell helps you with creating context in any case, boil it up to several lines.

Then in the program you can implement several code paths for different versions. Typically, lower versions of codecs of the OpenGL version have a large subset with higher versions of encodings. I recommend writing new code in the highest version, and then adding additional code codes (often just replacements that can be done by C preprocessor macros or similar) for lower versions until you reach the lowest common denominator of the functions you really need.

+1
source

Then you need to use OpenGL 1.1 and use the necessary (and supported) functions using wglGetProcAddress (on windows) or glXGetProcAddress (on linux).

Instead of using these two functions, you can use the GLEW library , which does this for you and is a cross-platform.

0
source

Source: https://habr.com/ru/post/1347747/


All Articles