From a2548e687bd5199f981d5e53ad83f66f7d040a17 Mon Sep 17 00:00:00 2001 From: luigi__ Date: Tue, 3 Feb 2009 17:34:10 +0000 Subject: [PATCH] Added GDI+ setup as I plan to rewrite the viewers soon (they'll use GDI+). But, we do keep DirectDraw for the main window! --- desmume/src/windows/DeSmuME_2008.vcproj | 4 ++-- desmume/src/windows/main.cpp | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/desmume/src/windows/DeSmuME_2008.vcproj b/desmume/src/windows/DeSmuME_2008.vcproj index 8a3bc1da6..3429ded08 100644 --- a/desmume/src/windows/DeSmuME_2008.vcproj +++ b/desmume/src/windows/DeSmuME_2008.vcproj @@ -1,7 +1,7 @@ + +using namespace Gdiplus; + //----Recent ROMs menu globals---------- vector RecentRoms; //The list of recent ROM filenames const unsigned int MAX_RECENT_ROMS = 10; //To change the recent rom max, simply change this number @@ -1302,6 +1306,17 @@ int WINAPI WinMain (HINSTANCE hThisInstance, int nFunsterStil) { + ULONG_PTR GdiplusToken; + GdiplusStartupInput GdiplusSI; + + GdiplusSI.GdiplusVersion = 1; + + if(GdiplusStartup(&GdiplusToken, &GdiplusSI, NULL) != Ok) + { + MessageBox(0, "Failed to initialize GDI+ !", "Severe error", MB_OK | MB_ICONERROR); + return 1; + } + InitializeCriticalSection(&win_sync); #ifdef GDB_STUB @@ -1635,6 +1650,8 @@ int WINAPI WinMain (HINSTANCE hThisInstance, CloseConsole(); + GdiplusShutdown(GdiplusToken); + return 0; }