Index: ddraw/glDirectDraw.cpp |
— | — | @@ -1962,7 +1962,7 @@ |
1963 | 1963 | {
|
1964 | 1964 | TRACE_ENTER(4,14,this,14,lpDDSCaps,14,lpdwTotal,14,lpdwFree);
|
1965 | 1965 | if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
1966 | | - if(GLEXT_NVX_gpu_memory_info)
|
| 1966 | + /*if(GLEXT_NVX_gpu_memory_info)
|
1967 | 1967 | {
|
1968 | 1968 | if(lpdwTotal) glGetIntegerv(GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX,(GLint*)lpdwTotal);
|
1969 | 1969 | if(lpdwFree) glGetIntegerv(GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX,(GLint*)lpdwFree);
|
— | — | @@ -1971,7 +1971,7 @@ |
1972 | 1972 | TRACE_EXIT(23,DD_OK);
|
1973 | 1973 | return DD_OK;
|
1974 | 1974 | }
|
1975 | | - else
|
| 1975 | + else*/
|
1976 | 1976 | {
|
1977 | 1977 | MEMORYSTATUS memstat;
|
1978 | 1978 | GlobalMemoryStatus(&memstat);
|
Index: ddraw/glExtensions.cpp |
— | — | @@ -95,6 +95,13 @@ |
96 | 96 | void (APIENTRY *glMatrixLoadfEXT)(GLenum mode, const GLfloat *m) = NULL;
|
97 | 97 | void (APIENTRY *glMatrixMultfEXT)(GLenum mode, const GLfloat *m) = NULL;
|
98 | 98 |
|
| 99 | +void (APIENTRY *glBindSampler)(GLuint unit, GLuint sampler) = NULL;
|
| 100 | +void (APIENTRY *glDeleteSamplers)(GLsizei n, const GLuint *samplers) = NULL;
|
| 101 | +void (APIENTRY *glGenSamplers)(GLsizei n, GLuint *samplers) = NULL;
|
| 102 | +void (APIENTRY *glSamplerParameterf)(GLuint sampler, GLenum pname, GLfloat param) = NULL;
|
| 103 | +void (APIENTRY *glSamplerParameteri)(GLuint sampler, GLenum pname, GLint param) = NULL;
|
| 104 | +void (APIENTRY *glSamplerParameterfv)(GLuint sampler, GLenum pname, const GLfloat *params) = NULL;
|
| 105 | +void (APIENTRY *glSamplerParameteriv)(GLuint sampler, GLenum pname, const GLint *params) = NULL;
|
99 | 106 |
|
100 | 107 | int GLEXT_ARB_framebuffer_object = 0;
|
101 | 108 | int GLEXT_EXT_framebuffer_object = 0;
|
— | — | @@ -106,6 +113,7 @@ |
107 | 114 | int GLEXT_ATI_meminfo = 0;
|
108 | 115 | int GLEXT_ARB_ES2_compatibility = 0;
|
109 | 116 | int GLEXT_EXT_direct_state_access = 0;
|
| 117 | +int GLEXT_ARB_sampler_objects = 0;
|
110 | 118 | int glver_major, glver_minor = 0;
|
111 | 119 | bool atimem = false;
|
112 | 120 |
|
— | — | @@ -173,7 +181,7 @@ |
174 | 182 | ExitProcess(-1);
|
175 | 183 | }
|
176 | 184 | const GLubyte *glextensions = glGetString(GL_EXTENSIONS);
|
177 | | - if(strstr((char*)glextensions,"GL_ARB_framebuffer_object")) GLEXT_ARB_framebuffer_object = 1;
|
| 185 | + if(strstr((char*)glextensions,"GL_ARB_framebuffer_object") || (glver_major >= 3)) GLEXT_ARB_framebuffer_object = 1;
|
178 | 186 | else GLEXT_ARB_framebuffer_object = 0;
|
179 | 187 | if(strstr((char*)glextensions,"GL_EXT_framebuffer_object")) GLEXT_EXT_framebuffer_object = 1;
|
180 | 188 | else GLEXT_EXT_framebuffer_object = 0;
|
— | — | @@ -181,18 +189,23 @@ |
182 | 190 | else GLEXT_NV_packed_depth_stencil = 0;
|
183 | 191 | if(strstr((char*)glextensions,"GL_EXT_packed_depth_stencil")) GLEXT_EXT_packed_depth_stencil = 1;
|
184 | 192 | else GLEXT_EXT_packed_depth_stencil = 0;
|
185 | | - if(strstr((char*)glextensions,"GL_ARB_depth_buffer_float")) GLEXT_ARB_depth_buffer_float = 1;
|
| 193 | + if(strstr((char*)glextensions,"GL_ARB_depth_buffer_float") || (glver_major >= 3)) GLEXT_ARB_depth_buffer_float = 1;
|
186 | 194 | else GLEXT_ARB_depth_buffer_float = 0;
|
187 | | - if(strstr((char*)glextensions,"GL_ARB_depth_texture")) GLEXT_ARB_depth_texture = 1;
|
| 195 | + if(strstr((char*)glextensions,"GL_ARB_depth_texture") || (glver_major >= 2)
|
| 196 | + || ((glver_major >= 1) && (glver_minor >= 4))) GLEXT_ARB_depth_texture = 1;
|
188 | 197 | else GLEXT_ARB_depth_texture = 0;
|
189 | 198 | if(strstr((char*)glextensions,"GL_NVX_gpu_memory_info")) GLEXT_NVX_gpu_memory_info = 1;
|
190 | 199 | else GLEXT_NVX_gpu_memory_info = 0;
|
191 | 200 | if(strstr((char*)glextensions,"GL_ATI_meminfo")) GLEXT_ATI_meminfo = 1;
|
192 | 201 | else GLEXT_ATI_meminfo = 0;
|
193 | | - if(strstr((char*)glextensions,"GL_ARB_ES2_compatibility")) GLEXT_ARB_ES2_compatibility = 1;
|
| 202 | + if(strstr((char*)glextensions,"GL_ARB_ES2_compatibility") || (glver_major >= 5)
|
| 203 | + || ((glver_major >= 4) && (glver_minor >= 1))) GLEXT_ARB_ES2_compatibility = 1;
|
194 | 204 | else GLEXT_ARB_ES2_compatibility = 0;
|
195 | 205 | if(strstr((char*)glextensions,"GL_EXT_direct_state_access")) GLEXT_EXT_direct_state_access = 1;
|
196 | 206 | else GLEXT_EXT_direct_state_access = 0;
|
| 207 | + if(strstr((char*)glextensions,"GL_ARB_sampler_objects") || (glver_major >= 4)
|
| 208 | + || ((glver_major >= 3) && (glver_minor >= 3))) GLEXT_ARB_sampler_objects = 1;
|
| 209 | + else GLEXT_ARB_sampler_objects = 0;
|
197 | 210 | bool broken_fbo = true;
|
198 | 211 | if(GLEXT_ARB_framebuffer_object)
|
199 | 212 | {
|
— | — | @@ -229,6 +242,10 @@ |
230 | 243 | glMatrixLoadfEXT = (PFNGLMATRIXLOADFEXTPROC)wglGetProcAddress("glMatrixLoadfEXT");
|
231 | 244 | glMatrixMultfEXT = (PFNGLMATRIXMULTFEXTPROC)wglGetProcAddress("glMatrixMultfEXT");
|
232 | 245 | }
|
| 246 | + if(GLEXT_ARB_sampler_objects)
|
| 247 | + {
|
| 248 | +
|
| 249 | + }
|
233 | 250 | if(broken_fbo)
|
234 | 251 | {
|
235 | 252 | MessageBox(NULL,_T("DXGL requires support for OpenGL Framebuffer Objects to function. \
|
Index: ddraw/glExtensions.h |
— | — | @@ -36,6 +36,7 @@ |
37 | 37 | extern int GLEXT_ATI_meminfo;
|
38 | 38 | extern int GLEXT_ARB_ES2_compatibility;
|
39 | 39 | extern int GLEXT_EXT_direct_state_access;
|
| 40 | +extern int GLEXT_ARB_sampler_objects;
|
40 | 41 | extern int glver_major;
|
41 | 42 | extern int glver_minor;
|
42 | 43 | #define GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX 0x9047
|
— | — | @@ -124,6 +125,14 @@ |
125 | 126 | GLAPI void (APIENTRY *glMatrixLoadfEXT)(GLenum mode, const GLfloat *m);
|
126 | 127 | GLAPI void (APIENTRY *glMatrixMultfEXT)(GLenum mode, const GLfloat *m);
|
127 | 128 |
|
| 129 | +GLAPI void (APIENTRY *glBindSampler)(GLuint unit, GLuint sampler);
|
| 130 | +GLAPI void (APIENTRY *glDeleteSamplers)(GLsizei n, const GLuint *samplers);
|
| 131 | +GLAPI void (APIENTRY *glGenSamplers)(GLsizei n, GLuint *samplers);
|
| 132 | +GLAPI void (APIENTRY *glSamplerParameterf)(GLuint sampler, GLenum pname, GLfloat param);
|
| 133 | +GLAPI void (APIENTRY *glSamplerParameteri)(GLuint sampler, GLenum pname, GLint param);
|
| 134 | +GLAPI void (APIENTRY *glSamplerParameterfv)(GLuint sampler, GLenum pname, const GLfloat *params);
|
| 135 | +GLAPI void (APIENTRY *glSamplerParameteriv)(GLuint sampler, GLenum pname, const GLint *params);
|
| 136 | +
|
128 | 137 | void InitGLExt();
|
129 | 138 |
|
130 | 139 | #endif //_GLEXTENSIONS_H
|