Workaround OpenGL init issue on Windows, hackish
This commit is contained in:
parent
423c510a17
commit
d245af34bb
3 changed files with 25 additions and 13 deletions
21
main.c
21
main.c
|
@ -384,8 +384,19 @@ HRESULT WINAPI DirectDrawCreate(GUID FAR* lpGUID, LPDIRECTDRAW FAR* lplpDD, IUnk
|
|||
|
||||
if(ddraw)
|
||||
{
|
||||
/* FIXME: check the calling module before passing the call! */
|
||||
return ddraw->DirectDrawCreate(lpGUID, lplpDD, pUnkOuter);
|
||||
|
||||
/*
|
||||
printf(" returning DDERR_DIRECTDRAWALREADYCREATED\n");
|
||||
return DDERR_DIRECTDRAWALREADYCREATED;
|
||||
*/
|
||||
}
|
||||
|
||||
HMODULE real_dll = LoadLibrary("system32\\ddraw.dll");
|
||||
if(!real_dll)
|
||||
{
|
||||
return DDERR_GENERIC;
|
||||
}
|
||||
|
||||
IDirectDrawImpl *This = (IDirectDrawImpl *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectDrawImpl));
|
||||
|
@ -394,6 +405,16 @@ HRESULT WINAPI DirectDrawCreate(GUID FAR* lpGUID, LPDIRECTDRAW FAR* lplpDD, IUnk
|
|||
*lplpDD = (LPDIRECTDRAW)This;
|
||||
ddraw = This;
|
||||
|
||||
This->DirectDrawCreate = (HRESULT WINAPI (*)(GUID FAR*, LPDIRECTDRAW FAR*, IUnknown FAR*))GetProcAddress(real_dll, "DirectDrawCreate");
|
||||
|
||||
CloseHandle(real_dll);
|
||||
|
||||
if(!This->DirectDrawCreate)
|
||||
{
|
||||
ddraw_Release(This);
|
||||
return DDERR_GENERIC;
|
||||
}
|
||||
|
||||
/* load configuration options from ddraw.ini */
|
||||
char cwd[MAX_PATH];
|
||||
char ini_path[MAX_PATH];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue