Index: ddraw/glDirect3D.cpp |
— | — | @@ -36,8 +36,14 @@ |
37 | 37 | 0, // dwMiscCaps
|
38 | 38 | D3DPRASTERCAPS_SUBPIXEL | D3DPRASTERCAPS_ZTEST, //dwRasterCaps
|
39 | 39 | D3DPCMPCAPS_LESSEQUAL, //dwZCmpCaps
|
40 | | - 0, //dwSrcBlendCaps
|
41 | | - 0, //dwDestBlendCaps
|
| 40 | + D3DPBLENDCAPS_ZERO | D3DPBLENDCAPS_ONE | D3DPBLENDCAPS_SRCCOLOR | D3DPBLENDCAPS_INVSRCCOLOR |
|
| 41 | + D3DPBLENDCAPS_SRCALPHA | D3DPBLENDCAPS_INVSRCALPHA | D3DPBLENDCAPS_DESTALPHA |
|
| 42 | + D3DPBLENDCAPS_INVDESTALPHA | D3DPBLENDCAPS_DESTCOLOR | D3DPBLENDCAPS_INVDESTCOLOR |
|
| 43 | + D3DPBLENDCAPS_SRCALPHASAT | D3DPBLENDCAPS_BOTHSRCALPHA | D3DPBLENDCAPS_BOTHINVSRCALPHA, //dwSrcBlendCaps
|
| 44 | + D3DPBLENDCAPS_ZERO | D3DPBLENDCAPS_ONE | D3DPBLENDCAPS_SRCCOLOR | D3DPBLENDCAPS_INVSRCCOLOR |
|
| 45 | + D3DPBLENDCAPS_SRCALPHA | D3DPBLENDCAPS_INVSRCALPHA | D3DPBLENDCAPS_DESTALPHA |
|
| 46 | + D3DPBLENDCAPS_INVDESTALPHA | D3DPBLENDCAPS_DESTCOLOR | D3DPBLENDCAPS_INVDESTCOLOR |
|
| 47 | + D3DPBLENDCAPS_SRCALPHASAT | D3DPBLENDCAPS_BOTHSRCALPHA | D3DPBLENDCAPS_BOTHINVSRCALPHA, //dwDestBlendCaps
|
42 | 48 | 0, //dwAlphaCmpCaps
|
43 | 49 | D3DPSHADECAPS_COLORGOURAUDRGB, //dwShadeCaps
|
44 | 50 | D3DPTEXTURECAPS_PERSPECTIVE, //dwTextureCaps
|
— | — | @@ -55,8 +61,14 @@ |
56 | 62 | 0, // dwMiscCaps
|
57 | 63 | D3DPRASTERCAPS_SUBPIXEL | D3DPRASTERCAPS_ZTEST, //dwRasterCaps
|
58 | 64 | D3DPCMPCAPS_LESSEQUAL, //dwZCmpCaps
|
59 | | - 0, //dwSrcBlendCaps
|
60 | | - 0, //dwDestBlendCaps
|
| 65 | + D3DPBLENDCAPS_ZERO | D3DPBLENDCAPS_ONE | D3DPBLENDCAPS_SRCCOLOR | D3DPBLENDCAPS_INVSRCCOLOR |
|
| 66 | + D3DPBLENDCAPS_SRCALPHA | D3DPBLENDCAPS_INVSRCALPHA | D3DPBLENDCAPS_DESTALPHA |
|
| 67 | + D3DPBLENDCAPS_INVDESTALPHA | D3DPBLENDCAPS_DESTCOLOR | D3DPBLENDCAPS_INVDESTCOLOR |
|
| 68 | + D3DPBLENDCAPS_SRCALPHASAT | D3DPBLENDCAPS_BOTHSRCALPHA | D3DPBLENDCAPS_BOTHINVSRCALPHA, //dwSrcBlendCaps
|
| 69 | + D3DPBLENDCAPS_ZERO | D3DPBLENDCAPS_ONE | D3DPBLENDCAPS_SRCCOLOR | D3DPBLENDCAPS_INVSRCCOLOR |
|
| 70 | + D3DPBLENDCAPS_SRCALPHA | D3DPBLENDCAPS_INVSRCALPHA | D3DPBLENDCAPS_DESTALPHA |
|
| 71 | + D3DPBLENDCAPS_INVDESTALPHA | D3DPBLENDCAPS_DESTCOLOR | D3DPBLENDCAPS_INVDESTCOLOR |
|
| 72 | + D3DPBLENDCAPS_SRCALPHASAT | D3DPBLENDCAPS_BOTHSRCALPHA | D3DPBLENDCAPS_BOTHINVSRCALPHA, //dwDestBlendCaps
|
61 | 73 | 0, //dwAlphaCmpCaps
|
62 | 74 | D3DPSHADECAPS_COLORGOURAUDRGB, //dwShadeCaps
|
63 | 75 | D3DPTEXTURECAPS_PERSPECTIVE, //dwTextureCaps
|
Index: ddraw/glDirectDraw.cpp |
— | — | @@ -1342,8 +1342,20 @@ |
1343 | 1343 | HRESULT WINAPI glDirectDraw7::GetAvailableVidMem(LPDDSCAPS2 lpDDSCaps2, LPDWORD lpdwTotal, LPDWORD lpdwFree)
|
1344 | 1344 | {
|
1345 | 1345 | if(!this) return DDERR_INVALIDPARAMS;
|
1346 | | - FIXME("IDirectDraw::GetAvailableVidMem: stub\n");
|
1347 | | - ERR(DDERR_GENERIC);
|
| 1346 | + if(GLEXT_NVX_gpu_memory_info)
|
| 1347 | + {
|
| 1348 | + if(lpdwTotal) glGetIntegerv(GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX,(GLint*)lpdwTotal);
|
| 1349 | + if(lpdwFree) glGetIntegerv(GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX,(GLint*)lpdwFree);
|
| 1350 | + return DD_OK;
|
| 1351 | + }
|
| 1352 | + else
|
| 1353 | + {
|
| 1354 | + MEMORYSTATUS memstat;
|
| 1355 | + GlobalMemoryStatus(&memstat);
|
| 1356 | + if(lpdwTotal) *lpdwTotal = memstat.dwTotalVirtual;
|
| 1357 | + if(lpdwFree) *lpdwFree = memstat.dwAvailVirtual;
|
| 1358 | + return DD_OK;
|
| 1359 | + }
|
1348 | 1360 | }
|
1349 | 1361 | HRESULT WINAPI glDirectDraw7::GetSurfaceFromDC(HDC hdc, LPDIRECTDRAWSURFACE7 *lpDDS)
|
1350 | 1362 | {
|
Index: ddraw/glExtensions.cpp |
— | — | @@ -89,7 +89,10 @@ |
90 | 90 | int GLEXT_EXT_packed_depth_stencil = 0;
|
91 | 91 | int GLEXT_ARB_depth_buffer_float = 0;
|
92 | 92 | int GLEXT_ARB_depth_texture = 0;
|
| 93 | +int GLEXT_NVX_gpu_memory_info = 0;
|
| 94 | +int GLEXT_ATI_meminfo = 0;
|
93 | 95 | int glver_major, glver_minor = 0;
|
| 96 | +bool atimem = false;
|
94 | 97 |
|
95 | 98 | void InitGLExt()
|
96 | 99 | {
|
— | — | @@ -159,6 +162,8 @@ |
160 | 163 | if(strstr((char*)glextensions,"GL_EXT_packed_depth_stencil")) GLEXT_EXT_packed_depth_stencil = 1;
|
161 | 164 | if(strstr((char*)glextensions,"GL_ARB_depth_buffer_float")) GLEXT_ARB_depth_buffer_float = 1;
|
162 | 165 | if(strstr((char*)glextensions,"GL_ARB_depth_texture")) GLEXT_ARB_depth_texture = 1;
|
| 166 | + if(strstr((char*)glextensions,"GL_NVX_gpu_memory_info")) GLEXT_NVX_gpu_memory_info = 1;
|
| 167 | + if(strstr((char*)glextensions,"GL_ATI_meminfo")) GLEXT_ATI_meminfo = 1;
|
163 | 168 | bool broken_fbo = true;
|
164 | 169 | if(GLEXT_ARB_framebuffer_object)
|
165 | 170 | {
|
Index: ddraw/glExtensions.h |
— | — | @@ -32,6 +32,10 @@ |
33 | 33 | extern int GLEXT_EXT_packed_depth_stencil;
|
34 | 34 | extern int GLEXT_ARB_depth_buffer_float;
|
35 | 35 | extern int GLEXT_ARB_depth_texture;
|
| 36 | +extern int GLEXT_NVX_gpu_memory_info;
|
| 37 | +extern int GLEXT_ATI_meminfo;
|
| 38 | +#define GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX 0x9047
|
| 39 | +#define GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX 0x9049
|
36 | 40 |
|
37 | 41 | #ifdef __GNUC__
|
38 | 42 | #undef GLAPI
|