add GFX2_Get_Window_Handle() to get the win32 HWND
and use it
This commit is contained in:
39
src/main.c
39
src/main.c
@@ -45,11 +45,18 @@
|
||||
#if defined(USE_SDL) || defined(USE_SDL2)
|
||||
#include <SDL.h>
|
||||
#include <SDL_image.h>
|
||||
|
||||
// There is no WM on the GP2X...
|
||||
#if !defined(__GP2X__) && !defined(__WIZ__) && !defined(__CAANOO__) && !defined(GCWZERO)
|
||||
#include <SDL_syswm.h>
|
||||
#endif
|
||||
|
||||
#if defined(WIN32)
|
||||
#include <windows.h>
|
||||
#include <shlwapi.h>
|
||||
#elif defined (__MINT__)
|
||||
#include <mint/osbind.h>
|
||||
#elif defined(__macosx__)
|
||||
#import <CoreFoundation/CoreFoundation.h>
|
||||
#import <sys/param.h>
|
||||
#elif defined(__FreeBSD__)
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
|
||||
#include "const.h"
|
||||
@@ -80,18 +87,6 @@
|
||||
#include "win32screen.h"
|
||||
#endif
|
||||
|
||||
#if defined(WIN32)
|
||||
#include <windows.h>
|
||||
#include <shlwapi.h>
|
||||
#elif defined (__MINT__)
|
||||
#include <mint/osbind.h>
|
||||
#elif defined(__macosx__)
|
||||
#import <CoreFoundation/CoreFoundation.h>
|
||||
#import <sys/param.h>
|
||||
#elif defined(__FreeBSD__)
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
|
||||
|
||||
#if defined (WIN32) && (defined(USE_SDL) || defined(USE_SDL2))
|
||||
// On Windows, SDL_putenv is not present in any compilable header.
|
||||
@@ -859,11 +854,8 @@ int Init_program(int argc,char * argv[])
|
||||
{
|
||||
//RECT r;
|
||||
#if defined(USE_SDL) || defined(USE_SDL2)
|
||||
static SDL_SysWMinfo pInfo;
|
||||
SDL_VERSION(&pInfo.version);
|
||||
SDL_GetWMInfo(&pInfo);
|
||||
//GetWindowRect(pInfo.window, &r);
|
||||
SetWindowPos(pInfo.window, 0, Config.Window_pos_x, Config.Window_pos_y, 0, 0, SWP_NOSIZE);
|
||||
//GetWindowRect(window, &r);
|
||||
SetWindowPos(GFX2_Get_Window_Handle(), 0, Config.Window_pos_x, Config.Window_pos_y, 0, 0, SWP_NOSIZE);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -1071,10 +1063,7 @@ void Program_shutdown(void)
|
||||
#if defined(USE_SDL) || defined(USE_SDL2)
|
||||
{
|
||||
RECT r;
|
||||
static SDL_SysWMinfo pInfo;
|
||||
|
||||
SDL_GetWMInfo(&pInfo);
|
||||
GetWindowRect(pInfo.window, &r);
|
||||
GetWindowRect(GFX2_Get_Window_Handle(), &r);
|
||||
|
||||
Config.Window_pos_x = r.left;
|
||||
Config.Window_pos_y = r.top;
|
||||
|
||||
Reference in New Issue
Block a user