HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RE_OGL.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: RE_OGL.h (C++)
7  *
8  * COMMENTS: Cross-platform wrapper for OpenGL
9  *
10  */
11 
12 #ifndef __RE_OGL_h__
13 #define __RE_OGL_h__
14 
15 #include <glcorearb.h>
16 
17 // Prevent GL.h from being included.
18 #define __gl_h_
19 #define __GL_H__
20 
21 #ifndef GL_POLYGON
22 #define GL_POLYGON 9
23 #endif
24 
25 #include <stddef.h>
26 
27 #include <SYS/SYS_Types.h>
28 
29 // Direct State access
30 typedef void (APIENTRYP RE_PFNGLBINDMULTITEXTUREEXTPROC) (GLenum texunit, GLenum target, GLuint texture);
31 
32 // NV Depth buffer float
33 typedef void (APIENTRYP RE_PFNGLDEPTHRANGEDNVPROC) (GLdouble near, GLdouble far);
34 typedef void (APIENTRYP RE_PFNGLDEPTHBOUNDSDNVPROC) (GLdouble near,GLdouble far);
35 typedef void (APIENTRYP RE_PFNGLCLEARDEPTHDNVPROC) (GLdouble value);
36 
37 #ifndef GL_TEXTURE_MAX_ANISOTROPY
38 #define GL_TEXTURE_MAX_ANISOTROPY 0x84FE
39 #endif
40 #ifndef GL_MAX_TEXTURE_MAX_ANISOTROPY
41 #define GL_MAX_TEXTURE_MAX_ANISOTROPY 0x84FF
42 #endif
43 
44 #ifndef GL_VBO_FREE_MEMORY_ATI
45 #define GL_VBO_FREE_MEMORY_ATI 0x87FB
46 #endif
47 #ifndef GL_TEXTURE_FREE_MEMORY_ATI
48 #define GL_TEXTURE_FREE_MEMORY_ATI 0x87FC
49 #endif
50 #ifndef GL_RENDERBUFFER_FREE_MEMORY_ATI
51 #define GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD
52 #endif
53 
54 #ifndef GL_GPU_MEM_INFO_TOTAL_AVAILABLE_MEM_NVX
55 #define GL_GPU_MEM_INFO_TOTAL_AVAILABLE_MEM_NVX 0x9048
56 #endif
57 
58 #ifndef GL_POINT_SPRITE
59 #define GL_POINT_SPRITE 0x8861
60 #endif
61 
62 #ifndef GL_GPU_MEM_INFO_CURRENT_AVAILABLE_MEM_NVX
63 #define GL_GPU_MEM_INFO_CURRENT_AVAILABLE_MEM_NVX 0x9049
64 #endif
65 #ifndef GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB
66 #define GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004
67 #endif
68 #ifndef GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB
69 #define GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256
70 #endif
71 #ifndef GLX_NO_RESET_NOTIFICATION_ARB
72 #define GLX_NO_RESET_NOTIFICATION_ARB 0x8261
73 #endif
74 #ifndef GLX_LOSE_CONTEXT_ON_RESET_ARB
75 #define GLX_LOSE_CONTEXT_ON_RESET_ARB 0x8252
76 #endif
77 
78 #ifdef WIN32
79 
80 #if 0
81 #include <windows.h>
82 typedef const char * (APIENTRYP RE_PFNWGLGETEXTENSIONSSTRINGPROC)(void);
83 typedef const char * (APIENTRYP RE_PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc);
84 typedef BOOL (APIENTRYP RE_PFNWGLSWAPINTERVALPROC) (int);
85 typedef BOOL (APIENTRYP RE_PFNWGLCHOOSEPIXELFORMATARBPROC)
86  (HDC hdc, const int *piAttribIList,
87  const FLOAT *pfAttribFList,
88  UINT nMaxFormats,
89  int *piFormats,
90  UINT *nNumFormats);
91 #else
92 typedef const char * (APIENTRYP RE_PFNWGLGETEXTENSIONSSTRINGPROC)(void);
93 typedef int (APIENTRYP RE_PFNWGLSWAPINTERVALPROC) (int);
94 #endif
95 #else
96 #ifndef PFNGLXSWAPINTERVALSGIPROC
97 typedef int (APIENTRYP RE_PFNGLXSWAPINTERVALSGIPROC)(int);
98 #else
99 #define RE_PFNGLXSWAPINTERVALSGIPROC PFNGLXSWAPINTERVALSGIPROC
100 #endif
101 #endif
102 
103 // For wglChoosePixelFormat()
104 #if defined(WIN32) && !defined(WGL_NUMBER_PIXEL_FORMATS_ARB)
105 #define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000
106 #define WGL_DRAW_TO_WINDOW_ARB 0x2001
107 #define WGL_DRAW_TO_BITMAP_ARB 0x2002
108 #define WGL_ACCELERATION_ARB 0x2003
109 #define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006
110 #define WGL_SWAP_METHOD_ARB 0x2007
111 #define WGL_SUPPORT_OPENGL_ARB 0x2010
112 #define WGL_DOUBLE_BUFFER_ARB 0x2011
113 #define WGL_COLOR_BITS_ARB 0x2014
114 #define WGL_RED_BITS_ARB 0x2015
115 #define WGL_RED_SHIFT_ARB 0x2016
116 #define WGL_GREEN_BITS_ARB 0x2017
117 #define WGL_GREEN_SHIFT_ARB 0x2018
118 #define WGL_BLUE_BITS_ARB 0x2019
119 #define WGL_BLUE_SHIFT_ARB 0x201A
120 #define WGL_ALPHA_BITS_ARB 0x201B
121 #define WGL_ALPHA_SHIFT_ARB 0x201C
122 #define WGL_ACCUM_BITS_ARB 0x201D
123 #define WGL_ACCUM_RED_BITS_ARB 0x201E
124 #define WGL_ACCUM_GREEN_BITS_ARB 0x201F
125 #define WGL_ACCUM_BLUE_BITS_ARB 0x2020
126 #define WGL_ACCUM_ALPHA_BITS_ARB 0x2021
127 #define WGL_DEPTH_BITS_ARB 0x2022
128 #define WGL_STENCIL_BITS_ARB 0x2023
129 #define WGL_FULL_ACCELERATION_ARB 0x2027
130 #define WGL_SWAP_EXCHANGE_ARB 0x2028
131 #define WGL_SAMPLE_BUFFERS_ARB 0x2041
132 #define WGL_SAMPLES_ARB 0x2042
133 #endif
134 
135 #ifndef GL_SHADING_LANGUAGE_VERSION
136 #define GL_SHADING_LANGUAGE_VERSION 0x8B8C
137 #endif
138 
139 #ifdef WIN32
140 #ifndef WGL_CONTEXT_MAJOR_VERSION_ARB
141 #define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091
142 #endif
143 #ifndef WGL_CONTEXT_MINOR_VERSION_ARB
144 #define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092
145 #endif
146 #ifndef WGL_CONTEXT_LAYER_PLANE_ARB
147 #define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093
148 #endif
149 #ifndef WGL_CONTEXT_FLAGS_ARB
150 #define WGL_CONTEXT_FLAGS_ARB 0x2094
151 #endif
152 #ifndef WGL_CONTEXT_PROFILE_MASK_ARB
153 #define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126
154 #endif
155 #ifndef WGL_CONTEXT_DEBUG_BIT_ARB
156 #define WGL_CONTEXT_DEBUG_BIT_ARB 0x0001
157 #endif
158 #ifndef WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB
159 #define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002
160 #endif
161 #ifndef WGL_CONTEXT_CORE_PROFILE_BIT_ARB
162 #define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001
163 #endif
164 #ifndef WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB
165 #define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002
166 #endif
167 #ifndef ERROR_INVALID_VERSION_ARB
168 #define ERROR_INVALID_VERSION_ARB 0x2095
169 #endif
170 
171 #if 0
172 typedef HGLRC (APIENTRYP RE_PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hdc,
173  HGLRC share,
174  const int *attrib_list);
175 #endif
176 
177 #endif
178 
179 // For EXT_external_objects
180 
181 #ifndef GL_EXT_memory_object
182 #define GL_EXT_memory_object 1
183 #define GL_TEXTURE_TILING_EXT 0x9580
184 #define GL_DEDICATED_MEMORY_OBJECT_EXT 0x9581
185 #define GL_PROTECTED_MEMORY_OBJECT_EXT 0x959B
186 #define GL_NUM_TILING_TYPES_EXT 0x9582
187 #define GL_TILING_TYPES_EXT 0x9583
188 #define GL_OPTIMAL_TILING_EXT 0x9584
189 #define GL_LINEAR_TILING_EXT 0x9585
190 #define GL_NUM_DEVICE_UUIDS_EXT 0x9596
191 #define GL_DEVICE_UUID_EXT 0x9597
192 #define GL_DRIVER_UUID_EXT 0x9598
193 #define GL_UUID_SIZE_EXT 16
194 #endif
195 typedef void (APIENTRYP RE_PFNGLGETUNSIGNEDBYTEVEXTPROC) (GLenum pname, GLubyte *data);
196 typedef void (APIENTRYP RE_PFNGLGETUNSIGNEDBYTEI_VEXTPROC) (GLenum target, GLuint index, GLubyte *data);
197 typedef void (APIENTRYP RE_PFNGLDELETEMEMORYOBJECTSEXTPROC) (GLsizei n, const GLuint *memoryObjects);
198 typedef GLboolean (APIENTRYP RE_PFNGLISMEMORYOBJECTEXTPROC) (GLuint memoryObject);
199 typedef void (APIENTRYP RE_PFNGLCREATEMEMORYOBJECTSEXTPROC) (GLsizei n, GLuint *memoryObjects);
200 typedef void (APIENTRYP RE_PFNGLMEMORYOBJECTPARAMETERIVEXTPROC) (GLuint memoryObject, GLenum pname, const GLint *params);
201 typedef void (APIENTRYP RE_PFNGLGETMEMORYOBJECTPARAMETERIVEXTPROC) (GLuint memoryObject, GLenum pname, GLint *params);
206 typedef void (APIENTRYP RE_PFNGLBUFFERSTORAGEMEMEXTPROC) (GLenum target, GLsizeiptr size, GLuint memory, GLuint64 offset);
207 typedef void (APIENTRYP RE_PFNGLTEXTURESTORAGEMEM2DEXTPROC) (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset);
211 typedef void (APIENTRYP RE_PFNGLNAMEDBUFFERSTORAGEMEMEXTPROC) (GLuint buffer, GLsizeiptr size, GLuint memory, GLuint64 offset);
212 typedef void (APIENTRYP RE_PFNGLTEXSTORAGEMEM1DEXTPROC) (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLuint memory, GLuint64 offset);
213 typedef void (APIENTRYP RE_PFNGLTEXTURESTORAGEMEM1DEXTPROC) (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLuint memory, GLuint64 offset);
214 
215 #ifndef GL_EXT_semaphore
216 #define GL_EXT_semaphore 1
217 #define GL_LAYOUT_GENERAL_EXT 0x958D
218 #define GL_LAYOUT_COLOR_ATTACHMENT_EXT 0x958E
219 #define GL_LAYOUT_DEPTH_STENCIL_ATTACHMENT_EXT 0x958F
220 #define GL_LAYOUT_DEPTH_STENCIL_READ_ONLY_EXT 0x9590
221 #define GL_LAYOUT_SHADER_READ_ONLY_EXT 0x9591
222 #define GL_LAYOUT_TRANSFER_SRC_EXT 0x9592
223 #define GL_LAYOUT_TRANSFER_DST_EXT 0x9593
224 #define GL_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_EXT 0x9530
225 #define GL_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_EXT 0x9531
226 #endif
227 typedef void (APIENTRYP RE_PFNGLGENSEMAPHORESEXTPROC) (GLsizei n, GLuint *semaphores);
228 typedef void (APIENTRYP RE_PFNGLDELETESEMAPHORESEXTPROC) (GLsizei n, const GLuint *semaphores);
229 typedef GLboolean (APIENTRYP RE_PFNGLISSEMAPHOREEXTPROC) (GLuint semaphore);
230 typedef void (APIENTRYP RE_PFNGLSEMAPHOREPARAMETERUI64VEXTPROC) (GLuint semaphore, GLenum pname, const GLuint64 *params);
231 typedef void (APIENTRYP RE_PFNGLGETSEMAPHOREPARAMETERUI64VEXTPROC) (GLuint semaphore, GLenum pname, GLuint64 *params);
232 typedef void (APIENTRYP RE_PFNGLWAITSEMAPHOREEXTPROC) (GLuint semaphore, GLuint numBufferBarriers, const GLuint *buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *srcLayouts);
233 typedef void (APIENTRYP RE_PFNGLSIGNALSEMAPHOREEXTPROC) (GLuint semaphore, GLuint numBufferBarriers, const GLuint *buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *dstLayouts);
234 
235 #ifdef WIN32
236 #ifndef GL_EXT_memory_object_win32
237 #define GL_EXT_memory_object_win32 1
238 #define GL_HANDLE_TYPE_OPAQUE_WIN32_EXT 0x9587
239 #define GL_HANDLE_TYPE_OPAQUE_WIN32_KMT_EXT 0x9588
240 #define GL_DEVICE_LUID_EXT 0x9599
241 #define GL_DEVICE_NODE_MASK_EXT 0x959A
242 #define GL_LUID_SIZE_EXT 8
243 #define GL_HANDLE_TYPE_D3D12_TILEPOOL_EXT 0x9589
244 #define GL_HANDLE_TYPE_D3D12_RESOURCE_EXT 0x958A
245 #define GL_HANDLE_TYPE_D3D11_IMAGE_EXT 0x958B
246 #define GL_HANDLE_TYPE_D3D11_IMAGE_KMT_EXT 0x958C
247 #endif
248 typedef void (APIENTRYP RE_PFNGLIMPORTMEMORYWIN32HANDLEEXTPROC) (GLuint memory, GLuint64 size, GLenum handleType, void *handle);
249 typedef void (APIENTRYP RE_PFNGLIMPORTMEMORYWIN32NAMEEXTPROC) (GLuint memory, GLuint64 size, GLenum handleType, const void *name);
250 #ifndef GL_EXT_semaphore_win32
251 #define GL_EXT_semaphore_win32 1
252 #define GL_HANDLE_TYPE_D3D12_FENCE_EXT 0x9594
253 #define GL_D3D12_FENCE_VALUE_EXT 0x9595
254 #endif
255 typedef void (APIENTRYP RE_PFNGLIMPORTSEMAPHOREWIN32HANDLEEXTPROC) (GLuint semaphore, GLenum handleType, void *handle);
256 typedef void (APIENTRYP RE_PFNGLIMPORTSEMAPHOREWIN32NAMEEXTPROC) (GLuint semaphore, GLenum handleType, const void *name);
257 #else
258 #ifndef GL_EXT_memory_object_fd
259 #define GL_EXT_memory_object_fd 1
260 #define GL_HANDLE_TYPE_OPAQUE_FD_EXT 0x9586
261 #endif
262 typedef void (APIENTRYP RE_PFNGLIMPORTMEMORYFDEXTPROC) (GLuint memory, GLuint64 size, GLenum handleType, GLint fd);
263 // GL_EXT_semaphore_fd
264 typedef void (APIENTRYP RE_PFNGLIMPORTSEMAPHOREFDEXTPROC) (GLuint semaphore, GLenum handleType, GLint fd);
265 #endif // ! WIN32
266 #endif // __RE_OGL_h__
GLsizei GLenum GLsizei GLsizei GLuint memory
Definition: RE_OGL.h:202
GLuint index
Definition: RE_OGL.h:196
typedef int(APIENTRYP RE_PFNGLXSWAPINTERVALSGIPROC)(int)
int GLint
Definition: cl.hpp:165
GLsizeiptr size
Definition: RE_OGL.h:206
GLsizei GLenum GLsizei GLsizei GLboolean fixedSampleLocations
Definition: RE_OGL.h:203
FLOAT
Definition: ImfPixelType.h:24
GLsizei const GLfloat * value
Definition: glcorearb.h:824
GLuint64 GLenum handleType
Definition: RE_OGL.h:262
GLuint * semaphores
Definition: RE_OGL.h:227
unsigned char GLboolean
Definition: glcorearb.h:95
ptrdiff_t GLsizeiptr
Definition: glcorearb.h:622
unsigned char GLubyte
Definition: glcorearb.h:96
GLenum target
Definition: RE_OGL.h:30
unsigned int GLuint
Definition: cl.hpp:167
unsigned int GLenum
Definition: cl.hpp:166
GLuint buffer
Definition: glcorearb.h:660
GLuint const GLuint GLuint const GLuint const GLenum * srcLayouts
Definition: RE_OGL.h:232
GLsizei GLenum GLsizei GLsizei GLuint GLuint64 offset
Definition: RE_OGL.h:202
GLsizei GLenum internalFormat
Definition: RE_OGL.h:202
typedef void(APIENTRYP RE_PFNGLBINDMULTITEXTUREEXTPROC)(GLenum texunit
GLsizei GLenum GLsizei GLsizei height
Definition: RE_OGL.h:202
int GLsizei
Definition: glcorearb.h:91
GLdouble n
Definition: glcorearb.h:2008
GLuint const GLuint GLuint numTextureBarriers
Definition: RE_OGL.h:232
GLenum const GLint * params
Definition: RE_OGL.h:200
uint64_t GLuint64
Definition: glcorearb.h:1525
GLsizei levels
Definition: RE_OGL.h:202
GLuint const GLuint * buffers
Definition: RE_OGL.h:232
GLuint const GLchar * name
Definition: glcorearb.h:786
GLsizei samples
Definition: RE_OGL.h:203
typedef GLboolean(APIENTRYP RE_PFNGLISMEMORYOBJECTEXTPROC)(GLuint memoryObject)
GLsizei GLenum GLsizei GLsizei GLsizei depth
Definition: RE_OGL.h:204
const GLuint * memoryObjects
Definition: RE_OGL.h:197
double GLdouble
Definition: glcorearb.h:93
GLuint const GLuint GLuint const GLuint * textures
Definition: RE_OGL.h:232
GLuint numBufferBarriers
Definition: RE_OGL.h:232
GLenum pname
Definition: RE_OGL.h:200
GLubyte * data
Definition: RE_OGL.h:195
#define APIENTRYP
Definition: glcorearb.h:55
GLuint const GLuint GLuint const GLuint const GLenum * dstLayouts
Definition: RE_OGL.h:233
GLdouble far
Definition: RE_OGL.h:33
GLuint64 GLenum GLint fd
Definition: RE_OGL.h:262
UINT
Definition: ImfPixelType.h:22
GLsizei GLenum GLsizei width
Definition: RE_OGL.h:202
GLenum GLuint texture
Definition: RE_OGL.h:30