Skip to content

Commit

Permalink
Merge pull request hrydgard#5234 from sum2012/patch-1
Browse files Browse the repository at this point in the history
Show warning instead of crash in windows non 32 bit colour
  • Loading branch information
hrydgard committed Jan 27, 2014
2 parents cc48822 + abbbdb4 commit b5d1064
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Windows/EmuThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,15 @@ unsigned int WINAPI TheThread(void *)

host->UpdateUI();

//Check Colour depth
HDC dc = GetDC(NULL);
u32 colour_depth = GetDeviceCaps(dc, BITSPIXEL);
ReleaseDC(NULL, dc);
if (colour_depth != 32){
MessageBoxA(0, "Please switch your display to 32-bit colour mode", "OpenGL Error", MB_OK);
ExitProcess(1);
}

std::string error_string;
if (!host->InitGL(&error_string)) {
Reporting::ReportMessage("OpenGL init error: %s", error_string.c_str());
Expand Down

0 comments on commit b5d1064

Please sign in to comment.