m64p: Hide the SDL window

This commit is contained in:
pjgat09 2013-04-30 20:46:25 +00:00
parent 7af28f1106
commit d7e3e4042b
2 changed files with 11 additions and 0 deletions

View File

@ -32,6 +32,7 @@
#include "m64p_vidext.h"
#include "vidext.h"
#include "callbacks.h"
#include "SDL_syswm.h"
#if SDL_VERSION_ATLEAST(2,0,0)
#include "vidext_sdl2_compat.h"
@ -183,6 +184,7 @@ EXPORT m64p_error CALL VidExt_SetVideoMode(int Width, int Height, int BitsPerPix
{
const SDL_VideoInfo *videoInfo;
int videoFlags = 0;
SDL_SysWMinfo SysInfo;
/* call video extension override if necessary */
if (l_VideoExtensionActive)
@ -225,6 +227,8 @@ EXPORT m64p_error CALL VidExt_SetVideoMode(int Width, int Height, int BitsPerPix
else
DebugMessage(M64MSG_INFO, "Setting video mode: %ix%i", Width, Height);
videoFlags |= SDL_NOFRAME;
l_pScreen = SDL_SetVideoMode(Width, Height, BitsPerPixel, videoFlags);
if (l_pScreen == NULL)
{
@ -232,6 +236,13 @@ EXPORT m64p_error CALL VidExt_SetVideoMode(int Width, int Height, int BitsPerPix
return M64ERR_SYSTEM_FAIL;
}
SDL_VERSION(&SysInfo.version);
if (SDL_GetWMInfo(&SysInfo))
{
// Hide the SDL window
ShowWindow(SysInfo.window,0);
}
SDL_ShowCursor(SDL_DISABLE);
l_Fullscreen = (ScreenMode == M64VIDEO_FULLSCREEN);