Bug 517959

Summary: GL 1.3 function pointer typedef's are missing
Product: [Fedora] Fedora Reporter: Hans de Goede <hdegoede>
Component: mesaAssignee: Adam Jackson <ajax>
Status: CLOSED CANTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: ajax
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-08-18 19:29:06 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Hans de Goede 2009-08-18 07:25:54 UTC
Not sure if this is a bug, but I still thought I should report it. I've seen 2 programs now which fail to compile on rawhide, because the function pointer typedef's for GL 1.3 functions are not defined by the rawhide OpenGL headers.

These function pointer typedefs, like for example PFNGLACTIVETEXTUREPROC, are
defined in GL/glext.h. But only if GL_VERSION_1_3 is not defined yet when glext.h
gets included. These days glext.h gets included automatically by GL.h, which
defines GL_VERSION_1_3, but does not define the function pointer typedefs.

For now I've worked around this in both programs using this (ugly) construction,
better suggestions are welcome:

#define __glext_h_  // Don't let gl.h include glext.h
#include <GL/gl.h>
#include <GL/glu.h>
#undef __glext_h_M
/* We want / need the OpenGL 1.3 function pointer typedefs */
#undef GL_VERSION_1_3
#include <GL/glext.h>

Note that under F-11, all that is needed is:
#include <GL/gl.h>
#include <GL/glu.h>

Comment 1 Adam Jackson 2009-08-18 19:29:06 UTC
This is intentional, afaict.  The reasoning appears to be the same as the #ifdef _XOPEN_SOURCE and such that happens in glibc's headers: avoid polluting the namespace of programs unless they were explicitly written to expect the newer APIs.  I think it's silly for pre-3.0 API, but it's the OpenGL ARB's decision, not mine.