zenilib: zenilib/jni/external/glew/auto/src/glew_init_glx.c Source File

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
glew_init_glx.c
Go to the documentation of this file.
1 /* ------------------------------------------------------------------------ */
2
3 GLboolean glxewGetExtension (const char* name)
4 {
5 const GLubyte* start;
6 const GLubyte* end;
7
8 if (glXGetCurrentDisplay == NULL) return GL_FALSE;
9 start = (const GLubyte*)glXGetClientString(glXGetCurrentDisplay(), GLX_EXTENSIONS);
10 if (0 == start) return GL_FALSE;
11 end = start + _glewStrLen(start);
12 return _glewSearchExtension(name, start, end);
13 }
14
15 GLenum glxewContextInit (GLXEW_CONTEXT_ARG_DEF_LIST)
16 {
17 int major, minor;
18 const GLubyte* extStart;
19 const GLubyte* extEnd;
20 /* initialize core GLX 1.2 */
21 if (_glewInit_GLX_VERSION_1_2(GLEW_CONTEXT_ARG_VAR_INIT)) return GLEW_ERROR_GLX_VERSION_11_ONLY;
22 /* initialize flags */
23 CONST_CAST(GLXEW_VERSION_1_0) = GL_TRUE;
24 CONST_CAST(GLXEW_VERSION_1_1) = GL_TRUE;
25 CONST_CAST(GLXEW_VERSION_1_2) = GL_TRUE;
26 CONST_CAST(GLXEW_VERSION_1_3) = GL_TRUE;
27 CONST_CAST(GLXEW_VERSION_1_4) = GL_TRUE;
28 /* query GLX version */
29 glXQueryVersion(glXGetCurrentDisplay(), &major, &minor);
30 if (major == 1 && minor <= 3)
31 {
32 switch (minor)
33 {
34 case 3:
35 CONST_CAST(GLXEW_VERSION_1_4) = GL_FALSE;
36 break;
37 case 2:
38 CONST_CAST(GLXEW_VERSION_1_4) = GL_FALSE;
39 CONST_CAST(GLXEW_VERSION_1_3) = GL_FALSE;
40 break;
41 default:
42 return GLEW_ERROR_GLX_VERSION_11_ONLY;
43 break;
44 }
45 }
46 /* query GLX extension string */
47 extStart = 0;
48 if (glXGetCurrentDisplay != NULL)
49 extStart = (const GLubyte*)glXGetClientString(glXGetCurrentDisplay(), GLX_EXTENSIONS);
50 if (extStart == 0)
51 extStart = (const GLubyte *)"";
52 extEnd = extStart + _glewStrLen(extStart);
53 /* initialize extensions */
GL_TRUE
#define GL_TRUE
Definition: gl2.h:51
GL_FALSE
#define GL_FALSE
Definition: gl2.h:50
_glewSearchExtension
static GLboolean _glewSearchExtension(const char *name, const GLubyte *start, const GLubyte *end)
Definition: glew_head.c:237
GLenum
unsigned int GLenum
Definition: gl2.h:23
GLXEW_VERSION_1_2
#define GLXEW_VERSION_1_2
Definition: glxew.h:194
NULL
#define NULL
Definition: ftobjs.h:61
start
GLuint start
Definition: glew.h:1239
GLboolean
unsigned char GLboolean
Definition: gl2.h:24
GLXEW_VERSION_1_4
#define GLXEW_VERSION_1_4
Definition: glxew.h:333
name
EGLImageKHR EGLint * name
Definition: eglext.h:284
GLXEW_VERSION_1_3
#define GLXEW_VERSION_1_3
Definition: glxew.h:319
GLXEW_CONTEXT_ARG_DEF_LIST
#define GLXEW_CONTEXT_ARG_DEF_LIST
Definition: glew_head.c:35
GLubyte
khronos_uint8_t GLubyte
Definition: gl2.h:30
glxewContextInit
GLenum glxewContextInit(GLXEW_CONTEXT_ARG_DEF_LIST)
Definition: glew_init_glx.c:15
glxewGetExtension
GLboolean glxewGetExtension(const char *name)
Definition: glew_init_glx.c:3
_glewStrLen
static GLuint _glewStrLen(const GLubyte *s)
Definition: glew_head.c:153
GLEW_CONTEXT_ARG_VAR_INIT
#define GLEW_CONTEXT_ARG_VAR_INIT
Definition: glew_head.c:30
GLXEW_VERSION_1_1
#define GLXEW_VERSION_1_1
Definition: glxew_head.h:103
GLEW_ERROR_GLX_VERSION_11_ONLY
#define GLEW_ERROR_GLX_VERSION_11_ONLY
Definition: glew_tail.h:8
GLXEW_VERSION_1_0
#define GLXEW_VERSION_1_0
Definition: glxew_head.h:86
glXGetClientString
#define glXGetClientString
Definition: glx_mangle.h:48
end
GLuint GLuint end
Definition: glew.h:1239
CONST_CAST
#define CONST_CAST(x)
Definition: glew_head.c:147
glXGetCurrentDisplay
Display * glXGetCurrentDisplay(void)
glXQueryVersion
#define glXQueryVersion
Definition: glx_mangle.h:38
GLX_EXTENSIONS
#define GLX_EXTENSIONS
Definition: glxew_head.h:97