1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
|
#ifndef _GLTOOL_H
#define _GLTOOL_H
/**
* gltool.h
*
* Copyright (C) 2001 Sven Goethel
*
* GNU Library General Public License
* as published by the Free Software Foundation
*
* http://www.gnu.org/copyleft/lgpl.html
* General dynamical loading OpenGL (GL/GLU) support for:
*
*
* <OS - System> <#define> commentary
* -----------------------------------------------
* GNU/Linux, Unices/X11 _X11_ (loads glx also)
* Macinstosh OS9 _MAC_OS9_
* Macinstosh OSX _MAC_OSX_
* Win32 _WIN32_
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#ifdef _WIN32_
#include <windows.h>
#ifdef LIBAPIENTRY
#undef LIBAPIENTRY
#endif
#ifdef LIBAPI
#undef LIBAPI
#endif
#define LIBAPI __declspec(dllexport)
#define LIBAPIENTRY __stdcall
#else
#include <ctype.h>
#include <math.h>
#define CALLBACK
#endif
#ifdef _X11_
#include <dlfcn.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#include <GL/glx.h>
#endif
#ifdef _MAC_OS9_
#include <agl.h>
#include <CodeFragments.h>
#include <Errors.h>
#include <TextUtils.h>
#include <StringCompare.h>
#define fragNoErr 0
#endif
#include <GL/gl.h>
#include <GL/glu.h>
#ifndef LIBAPIENTRY
#define LIBAPIENTRY
#endif
#ifndef LIBAPI
#define LIBAPI extern
#endif
LIBAPI const char * GLTOOL_USE_GLLIB ;
LIBAPI const char * GLTOOL_USE_GLULIB ;
#include "glcaps.h"
#include "gl-disp-var.h"
#include "glu-disp-var.h"
#ifndef GLDEBUG
#ifndef NDEBUG
#define NDEBUG
#endif
#else
#ifdef NDEBUG
#undef NDEBUG
#endif
#endif
#ifdef _WIN32_
#ifndef NDEBUG
#define CHECK_WGL_ERROR(a,b,c) check_wgl_error(a,b,c)
#else
#define CHECK_WGL_ERROR(a,b,c)
#endif
#else
#define CHECK_WGL_ERROR(a,b,c)
#endif
#ifndef NDEBUG
#define PRINT_GL_ERROR(a, b) print_gl_error((a), __FILE__, __LINE__, (b))
#define CHECK_GL_ERROR() check_gl_error(__FILE__,__LINE__)
#define GL_BEGIN(m) __sglBegin(__FILE__, __LINE__, (m))
#define GL_END() __sglEnd (__FILE__, __LINE__)
#define SHOW_GL_BEGINEND() showGlBeginEndBalance(__FILE__, __LINE__)
#define CHECK_GL_BEGINEND() checkGlBeginEndBalance(__FILE__, __LINE__)
#else
#define PRINT_GL_ERROR(a, b)
#define CHECK_GL_ERROR()
#define GL_BEGIN(m) disp__glBegin(m)
#define GL_END() disp__glEnd ()
#define SHOW_GL_BEGINEND()
#define CHECK_GL_BEGINEND()
#endif
#ifdef _WIN32_
LIBAPI void LIBAPIENTRY check_wgl_error
(HWND wnd, const char *file, int line);
#endif
LIBAPI void LIBAPIENTRY print_gl_error
(const char *msg, const char *file, int line, GLenum errorcode);
LIBAPI void LIBAPIENTRY check_gl_error
(const char *file, int line);
LIBAPI void LIBAPIENTRY showGlBeginEndBalance
(const char *file, int line);
LIBAPI void LIBAPIENTRY checkGlBeginEndBalance
(const char *file, int line);
LIBAPI void LIBAPIENTRY __sglBegin
(const char * file, int line, GLenum mode);
LIBAPI void LIBAPIENTRY __sglEnd
(const char * file, int line);
LIBAPI int LIBAPIENTRY unloadGLLibrary (void);
LIBAPI int LIBAPIENTRY loadGLLibrary
(const char * libGLName, const char * libGLUName);
LIBAPI void * LIBAPIENTRY getGLProcAddressHelper
(const char * libGLName, const char * libGLUName,
const char *func, int *method, int debug, int verbose);
LIBAPI void LIBAPIENTRY fetch_GL_FUNCS
(const char * libGLName, const char * libGLUName, int force, int reload);
#endif
|