All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
gl_funcptrs.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #ifdef __cplusplus
6 extern "C" {
7 #endif
8 
9 /* remove these where already defined as typedefs (GCC 4 complains of duplicate definitions) */
10 typedef void (GL_APIENTRY* PFNGLTEXIMAGE1DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
11 typedef void (GL_APIENTRY* PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
12 typedef void (GL_APIENTRY* PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
13 typedef void (GL_APIENTRY* PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
14 typedef void (GL_APIENTRY* PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
15 typedef void (GL_APIENTRY* PFNGLGENERATEMIPMAPPROC) (GLenum target);
16 
17 
18 /* Uncomment these where not already defined as functions. If GLEW
19  * is being used, they will most likely already be defined. */
20 /* PFNGLTEXIMAGE1DPROC glTexImage1D = 0; */
21 /* PFNGLTEXIMAGE3DPROC glTexImage3D = 0; */
22 /* PFNGLCOMPRESSEDTEXIMAGE1DPROC glCompressedTexImage1D = 0; */
23 /* PFNGLCOMPRESSEDTEXIMAGE3DPROC glCompressedTexImage3D = 0; */
24 /* PFNGLGENERATEMIPMAPPROC glGenerateMipmap = 0; */
25 
26 /* remove these where already defined as functions. GLEW probably
27  * already causes them to be defined and initializes them. */
28 extern PFNGLTEXIMAGE3DPROC glTexImage3D;
29 extern PFNGLCOMPRESSEDTEXIMAGE1DPROC glCompressedTexImage1D;
30 extern PFNGLCOMPRESSEDTEXIMAGE2DPROC glCompressedTexImage2D;
31 extern PFNGLCOMPRESSEDTEXIMAGE3DPROC glCompressedTexImage3D;
32 extern PFNGLGENERATEMIPMAPPROC glGenerateMipmap;
33 
34 /* and these */
35 #define DECLARE_GL_FUNCPTRS \
36  PFNGLTEXIMAGE3DPROC glTexImage3D = 0; \
37  PFNGLCOMPRESSEDTEXIMAGE1DPROC glCompressedTexImage1D = 0; \
38  PFNGLCOMPRESSEDTEXIMAGE2DPROC glCompressedTexImage2D = 0; \
39  PFNGLCOMPRESSEDTEXIMAGE3DPROC glCompressedTexImage3D = 0; \
40  PFNGLGENERATEMIPMAPPROC glGenerateMipmap = 0;
41 
42 /* remove this if you use GLEW and already have this */
43 extern int GLEW_OES_compressed_ETC1_RGB8_texture;
44 
45 /* and make this macro empty */
46 #define DECLARE_GL_EXTGLOBALS \
47  int GLEW_OES_compressed_ETC1_RGB8_texture = 0;
48 
49 #ifdef __cplusplus
50 }
51 #endif
52