freeglut extensions to glut unit
Original Reporter info from Mantis: Michalis @michaliskambi
-
Reporter name: Michalis Kamburelis
Original Reporter info from Mantis: Michalis @michaliskambi
- Reporter name: Michalis Kamburelis
Description:
freeglut library is essentially a glut with a couple of useful extensions and clear (X-Consortium) license. It is compatible (also binary compatible, const values match etc.) with original glut, so our glut unit already works with it without any problems.
Attaching a patch to add new freeglut-specific functions and constants to the glut unit. Everything is inside an {$ifdef FREEGLUT_EXTENSIONS}. See http://freeglut.sourceforge.net/docs/api.php#Introduction for a list of differences with some reasoning.
In my patch, FREEGLUT_EXTENSIONS is also defined at the top of the unit by default. If you don't have freeglut, appropriate entry points will be nil.
The patch is based on extensions listed in freeglut_ext.h header, as of freglut 2.6.0 (latest version, includes e.g. stuff for initializing OpenGL >= 3.x contexts). I omitted only glutJoystick* and glutWMCloseFunc functions (deprecated) and glutGetProcAddress (we have glext unit for this). I preserved the relevant comments from C headers.
I'm also attaching a sample freeglutdemo.pp, trivial program that uses some nice freeglut features. I propose to add this to packages/opengl/examples/, along with other GL-related examples.
*This patch works on x86 only if you manually undefine GLUT_EXCLUSIVE_FPUMODE in glut.pp. As I explained in #18107 (closed), I propose to remove GLUT_EXCLUSIVE_FPUMODE entirely. If you decide to keep GLUT_EXCLUSIVE_FPUMODE, then I'll resubmit another patch, that implements these extensions for both case (GLUT_EXCLUSIVE_FPUMODE defined and not).*
Mantis conversion info:
- Mantis ID: 18108
- Fixed in version: 2.4.4
- Fixed in revision: 16655 (#b58539a4)
- Monitored by: » darius (Darius Blaszijk)