|Delphi is already shipping with an OpenGL header, but that header is outdated and also buggy. Therefore we urge everyone to NOT use that header, especially as it lacks most of OpenGL's current functionality.|
The DelphiGL header
So to compensate for the flaws of the outdated and buggy default header that is shipped with Delphi, the (german) Delphi OpenGL Community is providing it's own header that's permanently updated to provide steady support for new OpenGL features and functionality. This makes updating to a new header version easily (usually backwards compatibility is preserved), and it's even possible to use the header with other pascal compilers like Freepascal.
It includes all OpenGL functions (currently up-to and including OpenGL 3.0) as well as all GLU (OpenGL Utility Libary) functions and supports all ARB, EXT, NV and ATI extensions. It also includes additional, though lesser common extensions from other vendors like Apple, HP and SGI.
A special feature of this header are boolean variables for each included extensions that are flagged upon initialisation (those boolean vars carry the same as their corresponding extensions), so you can quickly check wether an extension is support or not (instead of checking the strings returned by glGetString/en).
The dglOpenGL.pas is distributed unter the terms and conditions of the Mozilla Public License Version 1.1. You can grab a copy of that licence here.
The contents of the dglOpenGL.pas are used with permission, subject to
the Mozilla Public License Version 1.1 (the "License"); you may
not use this file except in compliance with the License. You may
obtain a copy of the License at
Software distributed under the License is distributed on an
"AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
implied. See the License for the specific language governing
rights and limitations under the License.
Due to lack of interest, .NET support has been removed as of header version 2.1!
|The .Net header won't be developed any further, but reported errors may be fixed. So new OpenGL functionality can only be found in the normal header.|
Initializing function pointers (crucial, see readme)
Along with the removal of .NET support, support for loading methods dynamically has also been removed and is no longer possible with the standard header. So it's crucial to call either AtivateRenderingContext or ReadExtensions alongside with ReadImplementationProperties in your application before accessing any of the OpenGL functions. Otherwise you'll likely be prompted with an access violation at address 0x00000000.
So if you get such an access violation please check if you called the above functions!
Current dglOpenGL.pas (Supports OpenGL 3.0))
Last dglOpenGL.pas wit .NET support (Supports OpenGL 2.1)
For Delphi 3 users :
Mars has posted a version of the dglOpenGL.pas that will work with Delphi 3, you can get it here :
dglOpenGL.pas for Delphi 3
(You need to be registered on the forums to download it)
There is also an inofficial version of this headers for C++.