mirror of
https://github.com/AppleWin/AppleWin.git
synced 2025-01-31 15:30:14 +00:00
Exit if fail to get instance of DirectX's SystemClock
This commit is contained in:
parent
ba668d1bac
commit
4be82324be
@ -620,7 +620,7 @@ int APIENTRY WinMain (HINSTANCE passinstance, HINSTANCE, LPSTR lpCmdLine, int)
|
||||
|
||||
// Initialize COM
|
||||
CoInitialize( NULL );
|
||||
SysClk_InitTimer();
|
||||
bool bSysClkOK = SysClk_InitTimer();
|
||||
// DSInit(); // Done when g_hFrameWindow is created (WM_CREATE)
|
||||
|
||||
// DO ONE-TIME INITIALIZATION
|
||||
@ -659,7 +659,14 @@ int APIENTRY WinMain (HINSTANCE passinstance, HINSTANCE, LPSTR lpCmdLine, int)
|
||||
MemInitialize();
|
||||
VideoInitialize();
|
||||
FrameCreateWindow();
|
||||
tfe_init();
|
||||
|
||||
if (!bSysClkOK)
|
||||
{
|
||||
MessageBox(g_hFrameWindow, "DirectX failed to create SystemClock instance", TEXT("AppleWin Error"), MB_OK);
|
||||
break;
|
||||
}
|
||||
|
||||
tfe_init();
|
||||
Snapshot_Startup(); // Do this after everything has been init'ed
|
||||
|
||||
if(bSetFullScreen)
|
||||
|
@ -566,7 +566,7 @@ static bool g_bRefClockTimerActive = false;
|
||||
static DWORD g_dwLastUsecPeriod = 0;
|
||||
|
||||
|
||||
void SysClk_InitTimer()
|
||||
bool SysClk_InitTimer()
|
||||
{
|
||||
g_hSemaphore = CreateSemaphore(NULL, 0, 1, NULL); // Max count = 1
|
||||
if (g_hSemaphore == NULL)
|
||||
@ -574,7 +574,12 @@ void SysClk_InitTimer()
|
||||
|
||||
if (CoCreateInstance(CLSID_SystemClock, NULL, CLSCTX_INPROC,
|
||||
IID_IReferenceClock, (LPVOID*)&g_pRefClock) != S_OK)
|
||||
{
|
||||
fprintf(stderr, "Error initialising COM\n");
|
||||
return false; // Fails for Win95!
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void SysClk_UninitTimer()
|
||||
|
@ -40,7 +40,7 @@ void DSUninit();
|
||||
LONG NewVolume(DWORD dwVolume, DWORD dwVolumeMax);
|
||||
|
||||
void SysClk_WaitTimer();
|
||||
void SysClk_InitTimer();
|
||||
bool SysClk_InitTimer();
|
||||
void SysClk_UninitTimer();
|
||||
void SysClk_StartTimerUsec(DWORD dwUsecPeriod);
|
||||
void SysClk_StopTimer();
|
||||
|
Loading…
x
Reference in New Issue
Block a user