Subversion Repositories eduke32

Rev

Rev 6948 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6948 Rev 7752
Line 1... Line 1...
1
/*
1
/*
2

2

3
    OpenGL, OpenGL ES loader generated by glad 0.1.25 on Mon Jul 23 02:57:25 2018.
3
    OpenGL, OpenGL ES loader generated by glad 0.1.30 on Thu Jul  4 02:00:01 2019.
4

4

5
    Language/Generator: C/C++
5
    Language/Generator: C/C++
6
    Specification: gl
6
    Specification: gl
7
    APIs: gl=2.0, gles2=2.0, gles1=1.0
7
    APIs: gl=2.0, gles2=2.0, gles1=1.0
8
    Profile: compatibility
8
    Profile: compatibility
9
    Extensions:
9
    Extensions:
10
        GL_ARB_buffer_storage,
10
        GL_ARB_buffer_storage,
-
 
11
        GL_ARB_clip_control,
11
        GL_ARB_debug_output,
12
        GL_ARB_debug_output,
-
 
13
        GL_ARB_depth_clamp,
12
        GL_ARB_map_buffer_range,
14
        GL_ARB_map_buffer_range,
-
 
15
        GL_ARB_shader_texture_lod,
13
        GL_ARB_sync,
16
        GL_ARB_sync,
14
        GL_ARB_texture_rectangle,
17
        GL_ARB_texture_rectangle,
15
        GL_EXT_fog_coord,
18
        GL_EXT_fog_coord,
16
        GL_EXT_framebuffer_object,
19
        GL_EXT_framebuffer_object,
17
        GL_EXT_texture_compression_s3tc,
20
        GL_EXT_texture_compression_s3tc,
Line 21... Line 24...
21
        GL_SGIS_fog_function,
24
        GL_SGIS_fog_function,
22
        GL_SGIX_fog_offset
25
        GL_SGIX_fog_offset
23
    Loader: True
26
    Loader: True
24
    Local files: False
27
    Local files: False
25
    Omit khrplatform: False
28
    Omit khrplatform: False
-
 
29
    Reproducible: False
26

30

27
    Commandline:
31
    Commandline:
28
        --profile="compatibility" --api="gl=2.0,gles2=2.0,gles1=1.0" --generator="c" --spec="gl" --extensions="GL_ARB_buffer_storage,GL_ARB_debug_output,GL_ARB_map_buffer_range,GL_ARB_sync,GL_ARB_texture_rectangle,GL_EXT_fog_coord,GL_EXT_framebuffer_object,GL_EXT_texture_compression_s3tc,GL_EXT_texture_filter_anisotropic,GL_NV_fog_distance,GL_NV_multisample_filter_hint,GL_SGIS_fog_function,GL_SGIX_fog_offset"
32
        --profile="compatibility" --api="gl=2.0,gles2=2.0,gles1=1.0" --generator="c" --spec="gl" --extensions="GL_ARB_buffer_storage,GL_ARB_clip_control,GL_ARB_debug_output,GL_ARB_depth_clamp,GL_ARB_map_buffer_range,GL_ARB_shader_texture_lod,GL_ARB_sync,GL_ARB_texture_rectangle,GL_EXT_fog_coord,GL_EXT_framebuffer_object,GL_EXT_texture_compression_s3tc,GL_EXT_texture_filter_anisotropic,GL_NV_fog_distance,GL_NV_multisample_filter_hint,GL_SGIS_fog_function,GL_SGIX_fog_offset"
29
    Online:
33
    Online:
30
        http://glad.dav1d.de/#profile=compatibility&language=c&specification=gl&loader=on&api=gl%3D2.0&api=gles2%3D2.0&api=gles1%3D1.0&extensions=GL_ARB_buffer_storage&extensions=GL_ARB_debug_output&extensions=GL_ARB_map_buffer_range&extensions=GL_ARB_sync&extensions=GL_ARB_texture_rectangle&extensions=GL_EXT_fog_coord&extensions=GL_EXT_framebuffer_object&extensions=GL_EXT_texture_compression_s3tc&extensions=GL_EXT_texture_filter_anisotropic&extensions=GL_NV_fog_distance&extensions=GL_NV_multisample_filter_hint&extensions=GL_SGIS_fog_function&extensions=GL_SGIX_fog_offset
34
        https://glad.dav1d.de/#profile=compatibility&language=c&specification=gl&loader=on&api=gl%3D2.0&api=gles2%3D2.0&api=gles1%3D1.0&extensions=GL_ARB_buffer_storage&extensions=GL_ARB_clip_control&extensions=GL_ARB_debug_output&extensions=GL_ARB_depth_clamp&extensions=GL_ARB_map_buffer_range&extensions=GL_ARB_shader_texture_lod&extensions=GL_ARB_sync&extensions=GL_ARB_texture_rectangle&extensions=GL_EXT_fog_coord&extensions=GL_EXT_framebuffer_object&extensions=GL_EXT_texture_compression_s3tc&extensions=GL_EXT_texture_filter_anisotropic&extensions=GL_NV_fog_distance&extensions=GL_NV_multisample_filter_hint&extensions=GL_SGIS_fog_function&extensions=GL_SGIX_fog_offset
31
*/
35
*/
32
36
33
#include <stdio.h>
37
#include <stdio.h>
34
#include <stdlib.h>
38
#include <stdlib.h>
35
#include <string.h>
39
#include <string.h>
Line 85... Line 89...
85
}
89
}
86
#else
90
#else
87
#include <dlfcn.h>
91
#include <dlfcn.h>
88
static void* libGL;
92
static void* libGL;
89
93
90
#ifndef __APPLE__
94
#if !defined(__APPLE__) && !defined(__HAIKU__)
91
typedef void* (APIENTRYP PFNGLXGETPROCADDRESSPROC_PRIVATE)(const char*);
95
typedef void* (APIENTRYP PFNGLXGETPROCADDRESSPROC_PRIVATE)(const char*);
92
static PFNGLXGETPROCADDRESSPROC_PRIVATE gladGetProcAddressPtr;
96
static PFNGLXGETPROCADDRESSPROC_PRIVATE gladGetProcAddressPtr;
93
#endif
97
#endif
94
98
95
static
99
static
Line 108... Line 112...
108
    unsigned int index = 0;
112
    unsigned int index = 0;
109
    for(index = 0; index < (sizeof(NAMES) / sizeof(NAMES[0])); index++) {
113
    for(index = 0; index < (sizeof(NAMES) / sizeof(NAMES[0])); index++) {
110
        libGL = dlopen(NAMES[index], RTLD_NOW | RTLD_GLOBAL);
114
        libGL = dlopen(NAMES[index], RTLD_NOW | RTLD_GLOBAL);
111
115
112
        if(libGL != NULL) {
116
        if(libGL != NULL) {
113
#ifdef __APPLE__
117
#if defined(__APPLE__) || defined(__HAIKU__)
114
            return 1;
118
            return 1;
115
#else
119
#else
116
            gladGetProcAddressPtr = (PFNGLXGETPROCADDRESSPROC_PRIVATE)dlsym(libGL,
120
            gladGetProcAddressPtr = (PFNGLXGETPROCADDRESSPROC_PRIVATE)dlsym(libGL,
117
                "glXGetProcAddressARB");
121
                "glXGetProcAddressARB");
118
            return gladGetProcAddressPtr != NULL;
122
            return gladGetProcAddressPtr != NULL;
Line 135... Line 139...
135
static
139
static
136
void* get_proc(const char *namez) {
140
void* get_proc(const char *namez) {
137
    void* result = NULL;
141
    void* result = NULL;
138
    if(libGL == NULL) return NULL;
142
    if(libGL == NULL) return NULL;
139
143
140
#ifndef __APPLE__
144
#if !defined(__APPLE__) && !defined(__HAIKU__)
141
    if(gladGetProcAddressPtr != NULL) {
145
    if(gladGetProcAddressPtr != NULL) {
142
        result = gladGetProcAddressPtr(namez);
146
        result = gladGetProcAddressPtr(namez);
143
    }
147
    }
144
#endif
148
#endif
145
    if(result == NULL) {
149
    if(result == NULL) {
Line 162... Line 166...
162
    }
166
    }
163
167
164
    return status;
168
    return status;
165
}
169
}
166
170
167
struct gladGLversionStruct GLVersion;
171
struct gladGLversionStruct GLVersion = { 0, 0 };
168
172
169
#if defined(GL_ES_VERSION_3_0) || defined(GL_VERSION_3_0)
173
#if defined(GL_ES_VERSION_3_0) || defined(GL_VERSION_3_0)
170
#define _GLAD_IS_SOME_NEW_VERSION 1
174
#define _GLAD_IS_SOME_NEW_VERSION 1
171
#endif
175
#endif
172
176
Line 187... Line 191...
187
        unsigned int index;
191
        unsigned int index;
188
192
189
        num_exts_i = 0;
193
        num_exts_i = 0;
190
        glGetIntegerv(GL_NUM_EXTENSIONS, &num_exts_i);
194
        glGetIntegerv(GL_NUM_EXTENSIONS, &num_exts_i);
191
        if (num_exts_i > 0) {
195
        if (num_exts_i > 0) {
192
            exts_i = (char **)realloc((void *)exts_i, (size_t)num_exts_i * (sizeof *exts_i));
196
            exts_i = (char **)malloc((size_t)num_exts_i * (sizeof *exts_i));
193
        }
197
        }
194
198
195
        if (exts_i == NULL) {
199
        if (exts_i == NULL) {
196
            return 0;
200
            return 0;
197
        }
201
        }
Line 261... Line 265...
261
    }
265
    }
262
#endif
266
#endif
263
267
264
    return 0;
268
    return 0;
265
}
269
}
934
static void load_GL_VERSION_1_0(GLADloadproc load) {
942
static void load_GL_VERSION_1_0(GLADloadproc load) {
935
        if(!GLAD_GL_VERSION_1_0) return;
943
        if(!GLAD_GL_VERSION_1_0) return;
936
        glad_glCullFace = (PFNGLCULLFACEPROC)load("glCullFace");
944
        glad_glCullFace = (PFNGLCULLFACEPROC)load("glCullFace");
937
        glad_glFrontFace = (PFNGLFRONTFACEPROC)load("glFrontFace");
945
        glad_glFrontFace = (PFNGLFRONTFACEPROC)load("glFrontFace");
938
        glad_glHint = (PFNGLHINTPROC)load("glHint");
946
        glad_glHint = (PFNGLHINTPROC)load("glHint");
Line 1499... Line 1507...
1499
}
1507
}
1500
static void load_GL_ARB_buffer_storage(GLADloadproc load) {
1508
static void load_GL_ARB_buffer_storage(GLADloadproc load) {
1501
        if(!GLAD_GL_ARB_buffer_storage) return;
1509
        if(!GLAD_GL_ARB_buffer_storage) return;
1502
        glad_glBufferStorage = (PFNGLBUFFERSTORAGEPROC)load("glBufferStorage");
1510
        glad_glBufferStorage = (PFNGLBUFFERSTORAGEPROC)load("glBufferStorage");
1503
}
1511
}
-
 
1512
static void load_GL_ARB_clip_control(GLADloadproc load) {
-
 
1513
        if(!GLAD_GL_ARB_clip_control) return;
-
 
1514
        glad_glClipControl = (PFNGLCLIPCONTROLPROC)load("glClipControl");
-
 
1515
}
1504
static void load_GL_ARB_debug_output(GLADloadproc load) {
1516
static void load_GL_ARB_debug_output(GLADloadproc load) {
1505
        if(!GLAD_GL_ARB_debug_output) return;
1517
        if(!GLAD_GL_ARB_debug_output) return;
1506
        glad_glDebugMessageControlARB = (PFNGLDEBUGMESSAGECONTROLARBPROC)load("glDebugMessageControlARB");
1518
        glad_glDebugMessageControlARB = (PFNGLDEBUGMESSAGECONTROLARBPROC)load("glDebugMessageControlARB");
1507
        glad_glDebugMessageInsertARB = (PFNGLDEBUGMESSAGEINSERTARBPROC)load("glDebugMessageInsertARB");
1519
        glad_glDebugMessageInsertARB = (PFNGLDEBUGMESSAGEINSERTARBPROC)load("glDebugMessageInsertARB");
1508
        glad_glDebugMessageCallbackARB = (PFNGLDEBUGMESSAGECALLBACKARBPROC)load("glDebugMessageCallbackARB");
1520
        glad_glDebugMessageCallbackARB = (PFNGLDEBUGMESSAGECALLBACKARBPROC)load("glDebugMessageCallbackARB");
Line 1557... Line 1569...
1557
        glad_glGetFogFuncSGIS = (PFNGLGETFOGFUNCSGISPROC)load("glGetFogFuncSGIS");
1569
        glad_glGetFogFuncSGIS = (PFNGLGETFOGFUNCSGISPROC)load("glGetFogFuncSGIS");
1558
}
1570
}
1559
static int find_extensionsGL(void) {
1571
static int find_extensionsGL(void) {
1560
        if (!get_exts()) return 0;
1572
        if (!get_exts()) return 0;
1561
        GLAD_GL_ARB_buffer_storage = has_ext("GL_ARB_buffer_storage");
1573
        GLAD_GL_ARB_buffer_storage = has_ext("GL_ARB_buffer_storage");
-
 
1574
        GLAD_GL_ARB_clip_control = has_ext("GL_ARB_clip_control");
1562
        GLAD_GL_ARB_debug_output = has_ext("GL_ARB_debug_output");
1575
        GLAD_GL_ARB_debug_output = has_ext("GL_ARB_debug_output");
-
 
1576
        GLAD_GL_ARB_depth_clamp = has_ext("GL_ARB_depth_clamp");
1563
        GLAD_GL_ARB_map_buffer_range = has_ext("GL_ARB_map_buffer_range");
1577
        GLAD_GL_ARB_map_buffer_range = has_ext("GL_ARB_map_buffer_range");
-
 
1578
        GLAD_GL_ARB_shader_texture_lod = has_ext("GL_ARB_shader_texture_lod");
1564
        GLAD_GL_ARB_sync = has_ext("GL_ARB_sync");
1579
        GLAD_GL_ARB_sync = has_ext("GL_ARB_sync");
1565
        GLAD_GL_ARB_texture_rectangle = has_ext("GL_ARB_texture_rectangle");
1580
        GLAD_GL_ARB_texture_rectangle = has_ext("GL_ARB_texture_rectangle");
1566
        GLAD_GL_EXT_fog_coord = has_ext("GL_EXT_fog_coord");
1581
        GLAD_GL_EXT_fog_coord = has_ext("GL_EXT_fog_coord");
1567
        GLAD_GL_EXT_framebuffer_object = has_ext("GL_EXT_framebuffer_object");
1582
        GLAD_GL_EXT_framebuffer_object = has_ext("GL_EXT_framebuffer_object");
1568
        GLAD_GL_EXT_texture_compression_s3tc = has_ext("GL_EXT_texture_compression_s3tc");
1583
        GLAD_GL_EXT_texture_compression_s3tc = has_ext("GL_EXT_texture_compression_s3tc");
Line 1638... Line 1653...
1638
        load_GL_VERSION_1_5(load);
1653
        load_GL_VERSION_1_5(load);
1639
        load_GL_VERSION_2_0(load);
1654
        load_GL_VERSION_2_0(load);
1640
1655
1641
        if (!find_extensionsGL()) return 0;
1656
        if (!find_extensionsGL()) return 0;
1642
        load_GL_ARB_buffer_storage(load);
1657
        load_GL_ARB_buffer_storage(load);
-
 
1658
        load_GL_ARB_clip_control(load);
1643
        load_GL_ARB_debug_output(load);
1659
        load_GL_ARB_debug_output(load);
1644
        load_GL_ARB_map_buffer_range(load);
1660
        load_GL_ARB_map_buffer_range(load);
1645
        load_GL_ARB_sync(load);
1661
        load_GL_ARB_sync(load);
1646
        load_GL_EXT_fog_coord(load);
1662
        load_GL_EXT_fog_coord(load);
1647
        load_GL_EXT_framebuffer_object(load);
1663
        load_GL_EXT_framebuffer_object(load);