Not logged in, Join Here! or Log In Below:  
News Articles Search    

 Home / Game Design & Programming / Dropping out of fullscreen and leaving a message box. Account Manager
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.

January 06, 2005, 08:27 AM

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,

  2. void GameWindow::ExitWithAlert(const char* fmt, ...)
  3. {
  4.         static char lpszAlertBuffer[XALINEBUFSIZE];
  6.         m_kScreen.Kill();
  8.         va_list ap;
  9.         va_start(ap,fmt);
  10.         vsprintf(lpszAlertBuffer,fmt,ap);
  11.         va_end(ap);
  13.         MessageBox(NULL,lpszAlertBuffer,"ExitWithAlert()",MB_OK);
  15.         //PostQuitMessage(1);
  16.         exit(1);
  17. }

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.

This thread contains 1 message.
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.