From 93cd5ecec3add947a3ffa726a22ec1a7b7d38fd9 Mon Sep 17 00:00:00 2001 From: sum2012 Date: Mon, 27 Jan 2014 07:36:39 +0800 Subject: [PATCH] Show warning instead of crash in windows non 32 bit colour --- Windows/EmuThread.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Windows/EmuThread.cpp b/Windows/EmuThread.cpp index 6cf9103f7f..4565e82cc4 100644 --- a/Windows/EmuThread.cpp +++ b/Windows/EmuThread.cpp @@ -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, "Only support 32 bit colour", "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());