Index: ddraw/glExtensions.cpp |
— | — | @@ -84,6 +84,18 @@ |
85 | 85 | BOOL (APIENTRY *wglSwapIntervalEXT)(int interval) = NULL;
|
86 | 86 | int (APIENTRY *wglGetSwapIntervalEXT)() = NULL;
|
87 | 87 |
|
| 88 | +void (APIENTRY *glTextureParameterfEXT)(GLuint texture, GLenum target, GLenum pname, GLfloat param) = NULL;
|
| 89 | +void (APIENTRY *glTextureParameterfvEXT)(GLuint texture, GLenum target, GLenum pname, const GLfloat *params) = NULL;
|
| 90 | +void (APIENTRY *glTextureParameteriEXT)(GLuint texture, GLenum target, GLenum pname, GLint param) = NULL;
|
| 91 | +void (APIENTRY *glTextureParameterivEXT)(GLuint texture, GLenum target, GLenum pname, const GLint *params) = NULL;
|
| 92 | +void (APIENTRY *glTextureImage2DEXT)(GLuint texture, GLenum target, GLint level, GLenum internalformat,
|
| 93 | + GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels) = NULL;
|
| 94 | +void (APIENTRY *glTextureSubImage2DEXT)(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset,
|
| 95 | + GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels) = NULL;
|
| 96 | +void (APIENTRY *glMatrixLoadfEXT)(GLenum mode, const GLfloat *m) = NULL;
|
| 97 | +void (APIENTRY *glMatrixMultfEXT)(GLenum mode, const GLfloat *m) = NULL;
|
| 98 | +
|
| 99 | +
|
88 | 100 | int GLEXT_ARB_framebuffer_object = 0;
|
89 | 101 | int GLEXT_EXT_framebuffer_object = 0;
|
90 | 102 | int GLEXT_NV_packed_depth_stencil = 0;
|
— | — | @@ -93,6 +105,7 @@ |
94 | 106 | int GLEXT_NVX_gpu_memory_info = 0;
|
95 | 107 | int GLEXT_ATI_meminfo = 0;
|
96 | 108 | int GLEXT_ARB_ES2_compatibility = 0;
|
| 109 | +int GLEXT_EXT_direct_state_access = 0;
|
97 | 110 | int glver_major, glver_minor = 0;
|
98 | 111 | bool atimem = false;
|
99 | 112 |
|
— | — | @@ -161,14 +174,25 @@ |
162 | 175 | }
|
163 | 176 | const GLubyte *glextensions = glGetString(GL_EXTENSIONS);
|
164 | 177 | if(strstr((char*)glextensions,"GL_ARB_framebuffer_object")) GLEXT_ARB_framebuffer_object = 1;
|
| 178 | + else GLEXT_ARB_framebuffer_object = 0;
|
165 | 179 | if(strstr((char*)glextensions,"GL_EXT_framebuffer_object")) GLEXT_EXT_framebuffer_object = 1;
|
| 180 | + else GLEXT_EXT_framebuffer_object = 0;
|
166 | 181 | if(strstr((char*)glextensions,"GL_NV_packed_depth_stencil")) GLEXT_NV_packed_depth_stencil = 1;
|
| 182 | + else GLEXT_NV_packed_depth_stencil = 0;
|
167 | 183 | if(strstr((char*)glextensions,"GL_EXT_packed_depth_stencil")) GLEXT_EXT_packed_depth_stencil = 1;
|
| 184 | + else GLEXT_EXT_packed_depth_stencil = 0;
|
168 | 185 | if(strstr((char*)glextensions,"GL_ARB_depth_buffer_float")) GLEXT_ARB_depth_buffer_float = 1;
|
| 186 | + else GLEXT_ARB_depth_buffer_float = 0;
|
169 | 187 | if(strstr((char*)glextensions,"GL_ARB_depth_texture")) GLEXT_ARB_depth_texture = 1;
|
| 188 | + else GLEXT_ARB_depth_texture = 0;
|
170 | 189 | if(strstr((char*)glextensions,"GL_NVX_gpu_memory_info")) GLEXT_NVX_gpu_memory_info = 1;
|
| 190 | + else GLEXT_NVX_gpu_memory_info = 0;
|
171 | 191 | if(strstr((char*)glextensions,"GL_ATI_meminfo")) GLEXT_ATI_meminfo = 1;
|
| 192 | + else GLEXT_ATI_meminfo = 0;
|
172 | 193 | if(strstr((char*)glextensions,"GL_ARB_ES2_compatibility")) GLEXT_ARB_ES2_compatibility = 1;
|
| 194 | + else GLEXT_ARB_ES2_compatibility = 0;
|
| 195 | + if(strstr((char*)glextensions,"GL_EXT_direct_state_access")) GLEXT_EXT_direct_state_access = 1;
|
| 196 | + else GLEXT_EXT_direct_state_access = 0;
|
173 | 197 | bool broken_fbo = true;
|
174 | 198 | if(GLEXT_ARB_framebuffer_object)
|
175 | 199 | {
|
— | — | @@ -194,6 +218,17 @@ |
195 | 219 | glDeleteFramebuffersEXT = (PFNGLDELETEFRAMEBUFFERSEXTPROC)wglGetProcAddress("glDeleteFramebuffersEXT");
|
196 | 220 | broken_fbo = false;
|
197 | 221 | }
|
| 222 | + if(GLEXT_EXT_direct_state_access)
|
| 223 | + {
|
| 224 | + glTextureParameterfEXT = (PFNGLTEXTUREPARAMETERFEXTPROC)wglGetProcAddress("glTextureParameterfEXT");
|
| 225 | + glTextureParameterfvEXT = (PFNGLTEXTUREPARAMETERFVEXTPROC)wglGetProcAddress("glTextureParameterfvEXT");
|
| 226 | + glTextureParameteriEXT = (PFNGLTEXTUREPARAMETERIEXTPROC)wglGetProcAddress("glTextureParameteriEXT");
|
| 227 | + glTextureParameterivEXT = (PFNGLTEXTUREPARAMETERIVEXTPROC)wglGetProcAddress("glTextureParameterivEXT");
|
| 228 | + glTextureImage2DEXT = (PFNGLTEXTUREIMAGE2DEXTPROC)wglGetProcAddress("glTextureImage2DEXT");
|
| 229 | + glTextureSubImage2DEXT = (PFNGLTEXTURESUBIMAGE2DEXTPROC)wglGetProcAddress("glTextureSubImage2DEXT");
|
| 230 | + glMatrixLoadfEXT = (PFNGLMATRIXLOADFEXTPROC)wglGetProcAddress("glMatrixLoadfEXT");
|
| 231 | + glMatrixMultfEXT = (PFNGLMATRIXMULTFEXTPROC)wglGetProcAddress("glMatrixMultfEXT");
|
| 232 | + }
|
198 | 233 | if(broken_fbo)
|
199 | 234 | {
|
200 | 235 | MessageBox(NULL,_T("DXGL requires support for OpenGL Framebuffer Objects to function. \
|
Index: ddraw/glExtensions.h |
— | — | @@ -35,6 +35,7 @@ |
36 | 36 | extern int GLEXT_NVX_gpu_memory_info;
|
37 | 37 | extern int GLEXT_ATI_meminfo;
|
38 | 38 | extern int GLEXT_ARB_ES2_compatibility;
|
| 39 | +extern int GLEXT_EXT_direct_state_access;
|
39 | 40 | extern int glver_major;
|
40 | 41 | extern int glver_minor;
|
41 | 42 | #define GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX 0x9047
|
— | — | @@ -112,6 +113,17 @@ |
113 | 114 | GLAPI BOOL (APIENTRY *wglSwapIntervalEXT)(int interval);
|
114 | 115 | GLAPI int (APIENTRY *wglGetSwapIntervalEXT)();
|
115 | 116 |
|
| 117 | +GLAPI void (APIENTRY *glTextureParameterfEXT)(GLuint texture, GLenum target, GLenum pname, GLfloat param);
|
| 118 | +GLAPI void (APIENTRY *glTextureParameterfvEXT)(GLuint texture, GLenum target, GLenum pname, const GLfloat *params);
|
| 119 | +GLAPI void (APIENTRY *glTextureParameteriEXT)(GLuint texture, GLenum target, GLenum pname, GLint param);
|
| 120 | +GLAPI void (APIENTRY *glTextureParameterivEXT)(GLuint texture, GLenum target, GLenum pname, const GLint *params);
|
| 121 | +GLAPI void (APIENTRY *glTextureImage2DEXT)(GLuint texture, GLenum target, GLint level, GLenum internalformat,
|
| 122 | + GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
| 123 | +GLAPI void (APIENTRY *glTextureSubImage2DEXT)(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset,
|
| 124 | + GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
|
| 125 | +GLAPI void (APIENTRY *glMatrixLoadfEXT)(GLenum mode, const GLfloat *m);
|
| 126 | +GLAPI void (APIENTRY *glMatrixMultfEXT)(GLenum mode, const GLfloat *m);
|
| 127 | +
|
116 | 128 | void InitGLExt();
|
117 | 129 |
|
118 | 130 | #endif //_GLEXTENSIONS_H
|