Forum > OpenGL

Provided GL, GLext librarys vs dglOpenGL

(1/5) > >>


I'm starting now with Open GL 3.3+
I was trying some simple like this with SDL2:
And now i'm reading some modern opengl tutorial like this:
Well, i go for standalone program like in the SDL tutorial, without use of lazarus (only FreePascal)

When i was analyzing the code, i saw these differences:

1.- GL and GL ext seems to be up to version 4.0. It seems pure header conversion and seems supported partially by lazarus crew
2.- dslOpenGL claims that their headers are bug free and are pure header conversion too and default lazarus gl libraries are buggy. It seems supported to 4.5 and have a support team.

Initializing these two library shows differences...
- Types aren't exactly the same. And constants seems not having exactly the same type
- dglOpenGL seems to have their own way to initilize
- dglOpenGL seems to need lazarus on their default (takes the form handle from lazarus, so for non gui or non-lazarus-gui like sdl seems to make their own context.

My question: What headers are you using and why?
What are these headers support?
What should i use, assuming i will not using lazarus forms?

Well, why am I asking this?
Because it doesn't seems some header interoperability. If you use (for example) SDL2 headers, you can use some (for example Jedi ones), and
replace these for others and don't expect very big trouble. In this case, if you (for example), change the GL and GLext header for dglOpenGL, it will simply not work and seems to be needed a translation work. I do not understand why ones are better than others and things like that as claims dglopengl for their headers.

I'm using dglopengl in my work application.

Reasons: I also use Delphi, they are mostly up to date, there is lot of code to find that uses them. I don't use SDL.

thx Marcov:

Did you have used GL and GLext?
If answer is Yes, is there Big difference besides header actualization?. In fast read these seems not equal


--- Quote from: damieiro on December 15, 2019, 09:36:22 pm ---thx Marcov:

Did you have used GL and GLext?

--- End quote ---

The Opengl parts of the Delphi application I have was based on a Opengl concept demo by Ales Katona in 2008-2009, using those headers. I don't exactly if he or I changed to the dglopengl headers.  Maybe for the font support ? But they were more out of sync in the past, than now.

Even though I have rewritten the whole opengl codebase in 2016-2018, I still use Windows specific opengl font support (wglusebitmapfont())

--- Quote ---If answer is Yes, is there Big difference besides header actualization?. In fast read these seems not equal

--- End quote ---

As said, mind share. Plenty of Delphi code and examples to find.

If you wish to use OpenGL Core specification using Lazarus you have three options:
 1. GL, GLext are included with FreePascal
 2. dglOpenGL
 3. glcorearb
The first two will support OpenGL legacy calls as well as modern OpenGL calls. The third option only supports modern OpenGL core functions. Since Linux and Windows support modern OpenGL with compatibility mode (core and legacy calls), you can choose any library. However, if you want to target Linux, Windows and MacOS, you should use glcorearb. MacOS supports legacy OpenGL functions only to OpenGL 2.1, while recent versions of OpenGL must be limited to the core specification.

Here are some Lazarus Core OpenGL demos that compile on MacOS, Linux and Windows.
They will work with the Windows, Cocoa (MacOS), GTK2, QT5, and GTK3 widget sets.


[0] Message Index

[#] Next page

Go to full version