Include glcorearb to allow OpenGL Core support
Original Reporter info from Mantis: crlab @neurolabusc1
-
Reporter name: Chris Rorden
Original Reporter info from Mantis: crlab @neurolabusc1
- Reporter name: Chris Rorden
Description:
Last summer (issue 0029051) I suggested updating glext.pp to support OpenGL CORE implementations (e.g. MacOS). However, modifying glext has several issues:
1.) Users have no way of telling if a function or constant is supported in the core implementation.
2.) My implementation differs from the reference C distribution, where users use gl/glext for compatibility implementations and glcorearb for core implementations.
3.) glext.pp uses "glGetString(GL_EXTENSIONS)" to check whether extensions exist, but this function is not supported by the Core spec.
Therefore, I have written a freepascal program (attached) that ports the official Khronos "glcorearb.h" to pascal (creating "glcorearb.pas", attached).
I would like to suggest we keep the same glext.pp that ships with fpc 3.0.0 (skipping patches I submitted in 0029051).
Steps to reproduce:
I have created 3 Lazarus tutorial projects to validate and demonstrate glcorearb
https://github.com/neurolabusc/OpenGLCoreTutorials
I have added the glcorearb to the Lazarus PLY/OBJ viewer Plyview:
https://github.com/neurolabusc/plyview
I have also added support for glcorearb to the Lazarus project Surf Ice (edit opts.inc for CoreGL)
https://github.com/neurolabusc/surf-ice
Finally, I added support to MRIcroGL (edit opts.inc for CoreGL)
https://github.com/neurolabusc/MRIcroGL
All of these projects compile and run on Linux, MacOS and Windows.
Additional information:
Only the attachment "glcorearb.pas" is required, the file glcorearb.h is the Khronos C header and c2p_glcorearb.pas is the tool I created to port glcorearb.h to glcorearb.pas.
Mantis conversion info:
- Mantis ID: 31301
- OS: Darwin
- OS Build: 10.11.6
- Build: 2015/11/14
- Platform: MacBook Retina
- Version: 3.0.0
- Monitored by: » @neurolabusc1 (Chris Rorden), » AntonK (Anton Kavalenka)