|
|
I've had a look around, and a lot of places tell me how to release the d3d object and other direct x elements, but I can not figure out how to drop back to the desktop to display a message box, and have the app quit. All I get is a message box appearing in front of my now blank screen, and once I click 'OK' it usually freezes.
This is the code I have,
void GameWindow::ExitWithAlert(const char* fmt, ...)
{
static char lpszAlertBuffer[XALINEBUFSIZE];
m_kScreen.Kill();
va_list ap;
va_start(ap,fmt);
va_end(ap);
MessageBox(NULL,lpszAlertBuffer,"ExitWithAlert()",MB_OK);
//PostQuitMessage(1);
}
|
I changed from PostQuitMessage to exit because m_kScreen.Kill() releases the d3ddevice and the d3d object, and then the app continues on until the quit message is interpreted, and this causes problems between these areas.
I don't really intend on leaving the exit in there, I'm hoping for a more elegant way of quitting.
|