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
    WGL loader generated by glad 0.1.25 on Mon Jul 23 02:57:35 2018.
3
    WGL loader generated by glad 0.1.30 on Thu Jul  4 02:04:37 2019.
4

4

5
    Language/Generator: C/C++
5
    Language/Generator: C/C++
6
    Specification: wgl
6
    Specification: wgl
7
    APIs: wgl=1.0
7
    APIs: wgl=1.0
8
    Profile: -
8
    Profile: -
Line 14... Line 14...
14
        WGL_EXT_extensions_string,
14
        WGL_EXT_extensions_string,
15
        WGL_EXT_swap_control
15
        WGL_EXT_swap_control
16
    Loader: True
16
    Loader: True
17
    Local files: False
17
    Local files: False
18
    Omit khrplatform: False
18
    Omit khrplatform: False
-
 
19
    Reproducible: False
19

20

20
    Commandline:
21
    Commandline:
21
        --api="wgl=1.0" --generator="c" --spec="wgl" --extensions="WGL_ARB_create_context,WGL_ARB_create_context_profile,WGL_ARB_extensions_string,WGL_ARB_pixel_format,WGL_EXT_extensions_string,WGL_EXT_swap_control"
22
        --api="wgl=1.0" --generator="c" --spec="wgl" --extensions="WGL_ARB_create_context,WGL_ARB_create_context_profile,WGL_ARB_extensions_string,WGL_ARB_pixel_format,WGL_EXT_extensions_string,WGL_EXT_swap_control"
22
    Online:
23
    Online:
23
        http://glad.dav1d.de/#language=c&specification=wgl&loader=on&api=wgl%3D1.0&extensions=WGL_ARB_create_context&extensions=WGL_ARB_create_context_profile&extensions=WGL_ARB_extensions_string&extensions=WGL_ARB_pixel_format&extensions=WGL_EXT_extensions_string&extensions=WGL_EXT_swap_control
24
        https://glad.dav1d.de/#language=c&specification=wgl&loader=on&api=wgl%3D1.0&extensions=WGL_ARB_create_context&extensions=WGL_ARB_create_context_profile&extensions=WGL_ARB_extensions_string&extensions=WGL_ARB_pixel_format&extensions=WGL_EXT_extensions_string&extensions=WGL_EXT_swap_control
24
*/
25
*/
25
26
26
#include <stdio.h>
27
#include <stdio.h>
27
#include <stdlib.h>
28
#include <stdlib.h>
28
#include <string.h>
29
#include <string.h>
Line 78... Line 79...
78
}
79
}
79
#else
80
#else
80
#include <dlfcn.h>
81
#include <dlfcn.h>
81
static void* libGL;
82
static void* libGL;
82
83
83
#ifndef __APPLE__
84
#if !defined(__APPLE__) && !defined(__HAIKU__)
84
typedef void* (APIENTRYP PFNGLXGETPROCADDRESSPROC_PRIVATE)(const char*);
85
typedef void* (APIENTRYP PFNGLXGETPROCADDRESSPROC_PRIVATE)(const char*);
85
static PFNGLXGETPROCADDRESSPROC_PRIVATE gladGetProcAddressPtr;
86
static PFNGLXGETPROCADDRESSPROC_PRIVATE gladGetProcAddressPtr;
86
#endif
87
#endif
87
88
88
static
89
static
Line 101... Line 102...
101
    unsigned int index = 0;
102
    unsigned int index = 0;
102
    for(index = 0; index < (sizeof(NAMES) / sizeof(NAMES[0])); index++) {
103
    for(index = 0; index < (sizeof(NAMES) / sizeof(NAMES[0])); index++) {
103
        libGL = dlopen(NAMES[index], RTLD_NOW | RTLD_GLOBAL);
104
        libGL = dlopen(NAMES[index], RTLD_NOW | RTLD_GLOBAL);
104
105
105
        if(libGL != NULL) {
106
        if(libGL != NULL) {
106
#ifdef __APPLE__
107
#if defined(__APPLE__) || defined(__HAIKU__)
107
            return 1;
108
            return 1;
108
#else
109
#else
109
            gladGetProcAddressPtr = (PFNGLXGETPROCADDRESSPROC_PRIVATE)dlsym(libGL,
110
            gladGetProcAddressPtr = (PFNGLXGETPROCADDRESSPROC_PRIVATE)dlsym(libGL,
110
                "glXGetProcAddressARB");
111
                "glXGetProcAddressARB");
111
            return gladGetProcAddressPtr != NULL;
112
            return gladGetProcAddressPtr != NULL;
Line 128... Line 129...
128
static
129
static
129
void* get_proc(const char *namez) {
130
void* get_proc(const char *namez) {
130
    void* result = NULL;
131
    void* result = NULL;
131
    if(libGL == NULL) return NULL;
132
    if(libGL == NULL) return NULL;
132
133
133
#ifndef __APPLE__
134
#if !defined(__APPLE__) && !defined(__HAIKU__)
134
    if(gladGetProcAddressPtr != NULL) {
135
    if(gladGetProcAddressPtr != NULL) {
135
        result = gladGetProcAddressPtr(namez);
136
        result = gladGetProcAddressPtr(namez);
136
    }
137
    }
137
#endif
138
#endif
138
    if(result == NULL) {
139
    if(result == NULL) {
Line 197... Line 198...
197
        extensions = terminator;
198
        extensions = terminator;
198
    }
199
    }
199
200
200
    return 0;
201
    return 0;
201
}
202
}
202
int GLAD_WGL_VERSION_1_0;
203
int GLAD_WGL_VERSION_1_0 = 0;
203
int GLAD_WGL_EXT_swap_control;
204
int GLAD_WGL_ARB_create_context = 0;
204
int GLAD_WGL_ARB_pixel_format;
205
int GLAD_WGL_ARB_create_context_profile = 0;
205
int GLAD_WGL_ARB_create_context_profile;
206
int GLAD_WGL_ARB_extensions_string = 0;
206
int GLAD_WGL_ARB_create_context;
207
int GLAD_WGL_ARB_pixel_format = 0;
207
int GLAD_WGL_ARB_extensions_string;
208
int GLAD_WGL_EXT_extensions_string = 0;
208
int GLAD_WGL_EXT_extensions_string;
209
int GLAD_WGL_EXT_swap_control = 0;
209
PFNWGLCREATECONTEXTATTRIBSARBPROC glad_wglCreateContextAttribsARB;
210
PFNWGLCREATECONTEXTATTRIBSARBPROC glad_wglCreateContextAttribsARB = NULL;
210
PFNWGLGETEXTENSIONSSTRINGARBPROC glad_wglGetExtensionsStringARB;
211
PFNWGLGETEXTENSIONSSTRINGARBPROC glad_wglGetExtensionsStringARB = NULL;
211
PFNWGLGETPIXELFORMATATTRIBIVARBPROC glad_wglGetPixelFormatAttribivARB;
212
PFNWGLGETPIXELFORMATATTRIBIVARBPROC glad_wglGetPixelFormatAttribivARB = NULL;
212
PFNWGLGETPIXELFORMATATTRIBFVARBPROC glad_wglGetPixelFormatAttribfvARB;
213
PFNWGLGETPIXELFORMATATTRIBFVARBPROC glad_wglGetPixelFormatAttribfvARB = NULL;
213
PFNWGLCHOOSEPIXELFORMATARBPROC glad_wglChoosePixelFormatARB;
214
PFNWGLCHOOSEPIXELFORMATARBPROC glad_wglChoosePixelFormatARB = NULL;
214
PFNWGLGETEXTENSIONSSTRINGEXTPROC glad_wglGetExtensionsStringEXT;
215
PFNWGLGETEXTENSIONSSTRINGEXTPROC glad_wglGetExtensionsStringEXT = NULL;
215
PFNWGLSWAPINTERVALEXTPROC glad_wglSwapIntervalEXT;
216
PFNWGLSWAPINTERVALEXTPROC glad_wglSwapIntervalEXT = NULL;
216
PFNWGLGETSWAPINTERVALEXTPROC glad_wglGetSwapIntervalEXT;
217
PFNWGLGETSWAPINTERVALEXTPROC glad_wglGetSwapIntervalEXT = NULL;
217
static void load_WGL_ARB_create_context(GLADloadproc load) {
218
static void load_WGL_ARB_create_context(GLADloadproc load) {
218
        if(!GLAD_WGL_ARB_create_context) return;
219
        if(!GLAD_WGL_ARB_create_context) return;
219
        glad_wglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC)load("wglCreateContextAttribsARB");
220
        glad_wglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC)load("wglCreateContextAttribsARB");
220
}
221
}
221
static void load_WGL_ARB_extensions_string(GLADloadproc load) {
222
static void load_WGL_ARB_extensions_string(GLADloadproc load) {