Index: common/version.h |
— | — | @@ -4,12 +4,12 @@ |
5 | 5 |
|
6 | 6 | #define DXGLMAJOR 0
|
7 | 7 | #define DXGLMINOR 1
|
8 | | -#define DXGLPOINT 4
|
| 8 | +#define DXGLPOINT 5
|
9 | 9 | #define DXGLBUILD 0
|
10 | 10 |
|
11 | 11 | #define DXGLVERNUMBER DXGLMAJOR,DXGLMINOR,DXGLPOINT,DXGLBUILD
|
12 | 12 | #define DXGLVERQWORD (((unsigned __int64)DXGLMAJOR<<48)+((unsigned __int64)DXGLMINOR<<32)+((unsigned __int64)DXGLPOINT<<16)+(unsigned __int64)DXGLBUILD)
|
13 | | -#define DXGLVERSTRING "0.1.4.0"
|
| 13 | +#define DXGLVERSTRING "0.1.5.0"
|
14 | 14 |
|
15 | 15 |
|
16 | 16 | #endif //__VERSION_H
|
Index: common/version.nsh |
— | — | @@ -1 +1 @@ |
2 | | -!define PRODUCT_VERSION "0.1.4" |
\ No newline at end of file |
| 2 | +!define PRODUCT_VERSION "0.1.5" |
\ No newline at end of file |
Index: ddraw/glDirectDraw.cpp |
— | — | @@ -58,7 +58,7 @@ |
59 | 59 | }
|
60 | 60 | if(!match) newcount++;
|
61 | 61 | }
|
62 | | - realloc(newarray,sizeof(DEVMODE)*newcount);
|
| 62 | + newarray = (DEVMODE*)realloc(newarray,sizeof(DEVMODE)*newcount);
|
63 | 63 | free(*array);
|
64 | 64 | *array = newarray;
|
65 | 65 | *count = newcount;
|
— | — | @@ -587,6 +587,7 @@ |
588 | 588 | }
|
589 | 589 | DeleteGL();
|
590 | 590 | ddenabled = false;
|
| 591 | + directdraw_created = false;
|
591 | 592 | }
|
592 | 593 |
|
593 | 594 | HRESULT WINAPI glDirectDraw7::QueryInterface(REFIID riid, void** ppvObj)
|
— | — | @@ -941,6 +942,7 @@ |
942 | 943 | useguid = true;
|
943 | 944 | FIXME("Display GUIDs not yet supported, using primary.\n");
|
944 | 945 | }
|
| 946 | + directdraw_created = true;
|
945 | 947 | initialized = true;
|
946 | 948 | return DD_OK;
|
947 | 949 | }
|
— | — | @@ -1347,6 +1349,7 @@ |
1348 | 1350 | {
|
1349 | 1351 | for(int i = 0; i < surfacecount; i++)
|
1350 | 1352 | if(surfaces[i] == surface) surfaces[i] = NULL;
|
| 1353 | + if(surface == primary) primary = NULL;
|
1351 | 1354 | }
|
1352 | 1355 |
|
1353 | 1356 | // DDRAW1 wrapper
|
Index: ddraw/glDirectDrawSurface.cpp |
— | — | @@ -901,6 +901,7 @@ |
902 | 902 | HRESULT WINAPI glDirectDrawSurface7::Restore()
|
903 | 903 | {
|
904 | 904 | LONG sizes[6];
|
| 905 | + if(!ddInterface->renderer) return DDERR_INVALIDOBJECT;
|
905 | 906 | if(hRC != ddInterface->renderer->hRC)
|
906 | 907 | {
|
907 | 908 | if(ddsd.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)
|
Index: ddraw/glRenderer.cpp |
— | — | @@ -136,6 +136,7 @@ |
137 | 137 | dib.enabled = false;
|
138 | 138 | hWnd = hwnd;
|
139 | 139 | hRenderWnd = NULL;
|
| 140 | + InitializeCriticalSection(&cs);
|
140 | 141 | if(fullscreen)
|
141 | 142 | {
|
142 | 143 | SetWindowLongPtrA(hWnd,GWL_EXSTYLE,WS_EX_APPWINDOW);
|
— | — | @@ -146,8 +147,7 @@ |
147 | 148 | {
|
148 | 149 | // TODO: Adjust window rect
|
149 | 150 | }
|
150 | | - SetWindowPos(hWnd,NULL,0,0,0,0,SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);
|
151 | | - InitializeCriticalSection(&cs);
|
| 151 | + SetWindowPos(hWnd,HWND_TOP,0,0,0,0,SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
|
152 | 152 | inputs[0] = (void*)width;
|
153 | 153 | inputs[1] = (void*)height;
|
154 | 154 | inputs[2] = (void*)bpp;
|
— | — | @@ -344,10 +344,6 @@ |
345 | 345 | TranslateMessage(&Msg);
|
346 | 346 | DispatchMessage(&Msg);
|
347 | 347 | }
|
348 | | - if(hRenderWnd) DestroyWindow(hRenderWnd);
|
349 | | - hRenderWnd = NULL;
|
350 | | - wndbusy = false;
|
351 | | - hRC = NULL;
|
352 | 348 | return 0;
|
353 | 349 | }
|
354 | 350 |
|
— | — | @@ -899,12 +895,20 @@ |
900 | 896 | glDeleteBuffers(1,&PBO);
|
901 | 897 | PBO = 0;
|
902 | 898 | }
|
903 | | - if(backbuffer) glDeleteTextures(1,&backbuffer);
|
| 899 | + if(backbuffer)
|
| 900 | + {
|
| 901 | + glDeleteTextures(1,&backbuffer);
|
| 902 | + backbuffer = 0;
|
| 903 | + backx = 0;
|
| 904 | + backy = 0;
|
| 905 | + }
|
904 | 906 | wglMakeCurrent(NULL,NULL);
|
905 | 907 | wglDeleteContext(hRC);
|
906 | 908 | };
|
907 | 909 | if(hDC) ReleaseDC(hRenderWnd,hDC);
|
908 | 910 | hDC = NULL;
|
| 911 | + wndbusy = false;
|
| 912 | + PostQuitMessage(0);
|
909 | 913 | return 0;
|
910 | 914 | case WM_SETCURSOR:
|
911 | 915 | hParent = GetParent(hwnd);
|
— | — | @@ -950,7 +954,6 @@ |
951 | 955 | else return SendMessage(hParent,msg,wParam,lParam);
|
952 | 956 | case GLEVENT_DELETE:
|
953 | 957 | DestroyWindow(hRenderWnd);
|
954 | | - wndbusy = false;
|
955 | 958 | return 0;
|
956 | 959 | case GLEVENT_CREATE:
|
957 | 960 | outputs[0] = (void*)_MakeTexture((GLint)inputs[0],(GLint)inputs[1],(GLint)inputs[2],(GLint)inputs[3],
|
Index: dxgltest/Tests2D.cpp |
— | — | @@ -160,6 +160,7 @@ |
161 | 161 |
|
162 | 162 | void RunTestMouse2D(int test, UINT Msg, WPARAM wParam, LPARAM lParam)
|
163 | 163 | {
|
| 164 | + if(!ddsrender) return;
|
164 | 165 | DDSURFACEDESC2 ddsd;
|
165 | 166 | ddsd.dwSize = sizeof(DDSURFACEDESC2);
|
166 | 167 | DDBLTFX bltfx;
|
— | — | @@ -635,6 +636,7 @@ |
636 | 637 |
|
637 | 638 | void RunTestTimed2D(int test)
|
638 | 639 | {
|
| 640 | + if(stoptimer) return;
|
639 | 641 | DDSCAPS2 ddscaps;
|
640 | 642 | ZeroMemory(&ddscaps,sizeof(DDSCAPS2));
|
641 | 643 | ddscaps.dwCaps = DDSCAPS_BACKBUFFER;
|
— | — | @@ -665,7 +667,7 @@ |
666 | 668 | if(backbuffers) temp1->Release();
|
667 | 669 | }
|
668 | 670 | }
|
669 | | - if(backbuffers) ddsrender->Flip(NULL,DDFLIP_WAIT);
|
| 671 | + if(backbuffers && ddsrender) ddsrender->Flip(NULL,DDFLIP_WAIT);
|
670 | 672 | break;
|
671 | 673 | }
|
672 | 674 | }
|
Index: dxgltest/timer.h |
— | — | @@ -20,6 +20,7 @@ |
21 | 21 | #define _TIMER_H
|
22 | 22 |
|
23 | 23 |
|
| 24 | +extern bool stoptimer;
|
24 | 25 | void StartTimer(HWND hWnd, UINT message, double framerate);
|
25 | 26 | void StopTimer();
|
26 | 27 |
|