Commit f6408982 authored by Sam Lantinga's avatar Sam Lantinga

Hi,

I have prepared a set of patches to readd WindowsCE support to SDL 1.3.
I've created a new GAPI/Rawframebuffer and a DirectDraw renderer.
Both renderers are work in progress and there are several unimplemented
cases. (Notably
RenderLine/RenderPoint/RenderFill/QueryTexturePixels/UpdateTexture and
texture blending )
Nevertheless I am successfully using these renderers together with the
SDL software renderer. (On most devices the SDL software renderer will
be much faster as there are only badly optimized vendor drivers available)

I send these patches now in this unpolished state because there seems to
be some interest in win ce and someone has to start supporting SDL 1.3

Now on to the patches:
wince_events_window_fixes.patch
fixes some wince incompatibilities and adds fullscreen support via
SHFullScreen. NOTE: This patch shouldn't have any side effects on
Windows, but I have NOT tested it on Windows, so please double-check.
This patch doesn't dependent on the following ones.

wince_renderers_system.patch
This patch does all necessary modifications to the SDL system.
- it adds the renderers to the configure system
- it adds the renderers to win32video

SDL_ceddrawrender.c
SDL_ceddrawrender.h
SDL_gapirender_c.h
SDL_gapirender.c
SDL_gapirender.h
these files add the new render drivers and should be placed in
src/video/win32

Some notes to people who want to test this:
- I have only compiled sdl with ming32ce, so the VisualC files are not
up to date
- As mingw32ce has no ddraw.h this file must be taken from the MS SDK
and modified to work with gcc
- I had to modify line 2611 in configure.in to
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lcoredll -lcommctrl -lmmtimer
-Wl,--image-base -Wl,0x10000"
otherwise GetCPinfo wouldn't link. If someone knows whats causing this
I'd be happy to hear about it.

It would be great if these patches could make their way into SVN as this
would make collaboration much much easier.

I'm out of office for the next week and therefore will be unavailable
via email.

Regards
Stefan

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403626
parent 2011e3d2
...@@ -2077,6 +2077,18 @@ CheckWIN32() ...@@ -2077,6 +2077,18 @@ CheckWIN32()
]) ])
fi fi
AC_MSG_CHECKING(Windows CE)
have_wince=no
AC_TRY_COMPILE([
#ifndef _WIN32_WCE
#error This is not Windows CE
#endif
],[
],[
have_wince=yes
])
AC_MSG_RESULT($have_wince)
dnl See if the user wants to redirect standard output to files dnl See if the user wants to redirect standard output to files
AC_ARG_ENABLE(stdio-redirect, AC_ARG_ENABLE(stdio-redirect,
AC_HELP_STRING([--enable-stdio-redirect], [Redirect STDIO to files on Win32 [[default=yes]]]), AC_HELP_STRING([--enable-stdio-redirect], [Redirect STDIO to files on Win32 [[default=yes]]]),
...@@ -2094,6 +2106,7 @@ AC_HELP_STRING([--enable-directx], [use DirectX for Win32 audio/video [[default= ...@@ -2094,6 +2106,7 @@ AC_HELP_STRING([--enable-directx], [use DirectX for Win32 audio/video [[default=
, enable_directx=yes) , enable_directx=yes)
if test x$enable_directx = xyes; then if test x$enable_directx = xyes; then
AC_CHECK_HEADER(d3d9.h, have_d3d=yes) AC_CHECK_HEADER(d3d9.h, have_d3d=yes)
AC_CHECK_HEADER(ddraw.h, have_ddraw=yes)
AC_CHECK_HEADER(dsound.h, have_dsound=yes) AC_CHECK_HEADER(dsound.h, have_dsound=yes)
AC_CHECK_HEADER(dinput.h, have_dinput=yes) AC_CHECK_HEADER(dinput.h, have_dinput=yes)
fi fi
...@@ -2556,6 +2569,18 @@ AC_HELP_STRING([--enable-render-gdi], [enable the GDI render driver [[default=ye ...@@ -2556,6 +2569,18 @@ AC_HELP_STRING([--enable-render-gdi], [enable the GDI render driver [[default=ye
if test x$enable_render_gdi = xyes; then if test x$enable_render_gdi = xyes; then
AC_DEFINE(SDL_VIDEO_RENDER_GDI) AC_DEFINE(SDL_VIDEO_RENDER_GDI)
fi fi
AC_ARG_ENABLE(render-gapi,
AC_HELP_STRING([--enable-render-gapi], [enable the GAPI/RAWFRAMEBUFFER render driver [[default=yes]]]),
, enable_render_gapi=yes)
if test x$enable_render_gapi = xyes -a x$have_wince = xyes; then
AC_DEFINE(SDL_VIDEO_RENDER_GAPI)
fi
AC_ARG_ENABLE(render-ddraw,
AC_HELP_STRING([--enable-render-ddraw], [enable the Mobile DirectDraw render driver [[default=yes]]]),
, enable_render_ddraw=yes)
if test x$enable_render_ddraw = xyes -a x$have_wince = xyes -a x$have_ddraw = xyes; then
AC_DEFINE(SDL_VIDEO_RENDER_DDRAW)
fi
AC_ARG_ENABLE(render-d3d, AC_ARG_ENABLE(render-d3d,
AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[default=yes]]]), AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[default=yes]]]),
, enable_render_d3d=yes) , enable_render_d3d=yes)
......
...@@ -278,7 +278,6 @@ ...@@ -278,7 +278,6 @@
#undef SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC #undef SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC
#undef SDL_VIDEO_DRIVER_DUMMY #undef SDL_VIDEO_DRIVER_DUMMY
#undef SDL_VIDEO_DRIVER_FBCON #undef SDL_VIDEO_DRIVER_FBCON
#undef SDL_VIDEO_DRIVER_GAPI
#undef SDL_VIDEO_DRIVER_GEM #undef SDL_VIDEO_DRIVER_GEM
#undef SDL_VIDEO_DRIVER_IPOD #undef SDL_VIDEO_DRIVER_IPOD
#undef SDL_VIDEO_DRIVER_NANOX #undef SDL_VIDEO_DRIVER_NANOX
...@@ -312,6 +311,8 @@ ...@@ -312,6 +311,8 @@
#undef SDL_VIDEO_RENDER_OGL #undef SDL_VIDEO_RENDER_OGL
#undef SDL_VIDEO_RENDER_OGL_ES #undef SDL_VIDEO_RENDER_OGL_ES
#undef SDL_VIDEO_RENDER_X11 #undef SDL_VIDEO_RENDER_X11
#undef SDL_VIDEO_RENDER_GAPI
#undef SDL_VIDEO_RENDER_DDRAW
/* Enable OpenGL support */ /* Enable OpenGL support */
#undef SDL_VIDEO_OPENGL #undef SDL_VIDEO_OPENGL
......
This diff is collapsed.
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
Stefan Klug
klug.stefan@gmx.de
*/
#include "SDL_config.h"
#if SDL_VIDEO_RENDER_DDRAW
extern void DDRAW_AddRenderDriver(_THIS);
#endif
/* vi: set ts=4 sw=4 expandtab: */
This diff is collapsed.
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
Stefan Klug
klug.stefan@gmx.de
*/
#include "SDL_config.h"
/* SDL surface based renderer implementation */
#if SDL_VIDEO_RENDER_GAPI
extern void GAPI_AddRenderDriver(_THIS);
#endif
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
Stefan Klug
klug.stefan@gmx.de
*/
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
/* hi res definitions */
typedef struct _RawFrameBufferInfo
{
WORD wFormat;
WORD wBPP;
VOID *pFramePointer;
int cxStride;
int cyStride;
int cxPixels;
int cyPixels;
} RawFrameBufferInfo;
#define GETRAWFRAMEBUFFER 0x00020001
#define FORMAT_565 1
#define FORMAT_555 2
#define FORMAT_OTHER 3
/* From gx.h, since it's not really C compliant */
struct GXDisplayProperties
{
DWORD cxWidth;
DWORD cyHeight; // notice lack of 'th' in the word height.
long cbxPitch; // number of bytes to move right one x pixel - can be negative.
long cbyPitch; // number of bytes to move down one y pixel - can be negative.
long cBPP; // # of bits in each pixel
DWORD ffFormat; // format flags.
};
struct GXKeyList
{
short vkUp; // key for up
POINT ptUp; // x,y position of key/button. Not on screen but in screen coordinates.
short vkDown;
POINT ptDown;
short vkLeft;
POINT ptLeft;
short vkRight;
POINT ptRight;
short vkA;
POINT ptA;
short vkB;
POINT ptB;
short vkC;
POINT ptC;
short vkStart;
POINT ptStart;
};
typedef int (*PFNGXOpenDisplay) (HWND hWnd, DWORD dwFlags);
typedef int (*PFNGXCloseDisplay) ();
typedef void *(*PFNGXBeginDraw) ();
typedef int (*PFNGXEndDraw) ();
typedef int (*PFNGXOpenInput) ();
typedef int (*PFNGXCloseInput) ();
typedef struct GXDisplayProperties (*PFNGXGetDisplayProperties) ();
typedef struct GXKeyList (*PFNGXGetDefaultKeys) (int iOptions);
typedef int (*PFNGXSuspend) ();
typedef int (*PFNGXResume) ();
typedef int (*PFNGXSetViewport) (DWORD dwTop, DWORD dwHeight,
DWORD dwReserved1, DWORD dwReserved2);
typedef BOOL(*PFNGXIsDisplayDRAMBuffer) ();
struct GapiFunc
{
PFNGXOpenDisplay GXOpenDisplay;
PFNGXCloseDisplay GXCloseDisplay;
PFNGXBeginDraw GXBeginDraw;
PFNGXEndDraw GXEndDraw;
PFNGXOpenInput GXOpenInput;
PFNGXCloseInput GXCloseInput;
PFNGXGetDisplayProperties GXGetDisplayProperties;
PFNGXGetDefaultKeys GXGetDefaultKeys;
PFNGXSuspend GXSuspend;
PFNGXResume GXResume;
PFNGXSetViewport GXSetViewport;
PFNGXIsDisplayDRAMBuffer GXIsDisplayDRAMBuffer;
} gx;
#define kfLandscape 0x8 // Screen is rotated 270 degrees
#define kfPalette 0x10 // Pixel values are indexes into a palette
#define kfDirect 0x20 // Pixel values contain actual level information
#define kfDirect555 0x40 // 5 bits each for red, green and blue values in a pixel.
#define kfDirect565 0x80 // 5 red bits, 6 green bits and 5 blue bits per pixel
#define kfDirect888 0x100 // 8 bits each for red, green and blue values in a pixel.
#define kfDirect444 0x200 // 4 red, 4 green, 4 blue
#define kfDirectInverted 0x400
#define GX_FULLSCREEN 0x01 // for OpenDisplay()
#define GX_NORMALKEYS 0x02
#define GX_LANDSCAPEKEYS 0x03
...@@ -473,6 +473,7 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) ...@@ -473,6 +473,7 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
int x, y; int x, y;
int w, h; int w, h;
int style; int style;
BOOL menu;
/* If we allow resizing, let the resize happen naturally */ /* If we allow resizing, let the resize happen naturally */
if (SDL_GetWindowFlags(data->windowID) & SDL_WINDOW_RESIZABLE) { if (SDL_GetWindowFlags(data->windowID) & SDL_WINDOW_RESIZABLE) {
...@@ -491,15 +492,19 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) ...@@ -491,15 +492,19 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
size.bottom = h; size.bottom = h;
size.right = w; size.right = w;
style = GetWindowLong(hwnd, GWL_STYLE);
#ifdef _WIN32_WCE
menu = FALSE;
#else
/* DJM - according to the docs for GetMenu(), the /* DJM - according to the docs for GetMenu(), the
return value is undefined if hwnd is a child window. return value is undefined if hwnd is a child window.
Aparently it's too difficult for MS to check Aparently it's too difficult for MS to check
inside their function, so I have to do it here. inside their function, so I have to do it here.
*/ */
style = GetWindowLong(hwnd, GWL_STYLE); menu = (style & WS_CHILDWINDOW) ? FALSE : (GetMenu(hwnd) != NULL);
AdjustWindowRect(&size, style, #endif
style & WS_CHILDWINDOW ? FALSE : GetMenu(hwnd) AdjustWindowRectEx(&size, style, menu, 0);
!= NULL);
w = size.right - size.left; w = size.right - size.left;
h = size.bottom - size.top; h = size.bottom - size.top;
......
...@@ -59,6 +59,12 @@ WIN_DeleteDevice(SDL_VideoDevice * device) ...@@ -59,6 +59,12 @@ WIN_DeleteDevice(SDL_VideoDevice * device)
IDirect3D9_Release(data->d3d); IDirect3D9_Release(data->d3d);
FreeLibrary(data->d3dDLL); FreeLibrary(data->d3dDLL);
} }
#endif
#if SDL_VIDEO_RENDER_DDRAW
if (data->ddraw) {
data->ddraw->lpVtbl->Release(data->ddraw);
FreeLibrary(data->ddrawDLL);
}
#endif #endif
if (data->wintabDLL) { if (data->wintabDLL) {
FreeLibrary(data->wintabDLL); FreeLibrary(data->wintabDLL);
...@@ -106,6 +112,24 @@ WIN_CreateDevice(int devindex) ...@@ -106,6 +112,24 @@ WIN_CreateDevice(int devindex)
} }
} }
#endif /* SDL_VIDEO_RENDER_D3D */ #endif /* SDL_VIDEO_RENDER_D3D */
#if SDL_VIDEO_RENDER_DDRAW
data->ddrawDLL = LoadLibrary(TEXT("ddraw.dll"));
if (data->ddrawDLL) {
IDirectDraw *(WINAPI * DDCreate) (GUID FAR * lpGUID,
LPDIRECTDRAW FAR * lplpDD,
IUnknown FAR * pUnkOuter);
DDCreate =
(IDirectDraw *
(WINAPI *) (GUID FAR *, LPDIRECTDRAW FAR *, IUnknown FAR *))
GetProcAddress(data->ddrawDLL, TEXT("DirectDrawCreate"));
if (!DDCreate || DDCreate(NULL, &data->ddraw, NULL) != DD_OK) {
FreeLibrary(data->ddrawDLL);
data->ddrawDLL = NULL;
data->ddraw = NULL;
}
}
#endif /* SDL_VIDEO_RENDER_DDRAW */
data->wintabDLL = LoadLibrary(TEXT("WINTAB32.DLL")); data->wintabDLL = LoadLibrary(TEXT("WINTAB32.DLL"));
if (data->wintabDLL) { if (data->wintabDLL) {
...@@ -188,9 +212,15 @@ WIN_VideoInit(_THIS) ...@@ -188,9 +212,15 @@ WIN_VideoInit(_THIS)
#if SDL_VIDEO_RENDER_D3D #if SDL_VIDEO_RENDER_D3D
D3D_AddRenderDriver(_this); D3D_AddRenderDriver(_this);
#endif #endif
#if SDL_VIDEO_RENDER_DDRAW
DDRAW_AddRenderDriver(_this);
#endif
#if SDL_VIDEO_RENDER_GDI #if SDL_VIDEO_RENDER_GDI
GDI_AddRenderDriver(_this); GDI_AddRenderDriver(_this);
#endif #endif
#if SDL_VIDEO_RENDER_GAPI
GAPI_AddRenderDriver(_this);
#endif
g_hCtx = SDL_malloc(sizeof(HCTX)); g_hCtx = SDL_malloc(sizeof(HCTX));
WIN_InitKeyboard(_this); WIN_InitKeyboard(_this);
......
...@@ -37,6 +37,12 @@ ...@@ -37,6 +37,12 @@
#include "d3d9.h" #include "d3d9.h"
#endif #endif
#if SDL_VIDEO_RENDER_DDRAW
/* WIN32_LEAN_AND_MEAN was defined, so we have to include this by hand */
#include <objbase.h>
#include "ddraw.h"
#endif
#include "wactab/wintab.h" #include "wactab/wintab.h"
#define PACKETDATA ( PK_X | PK_Y | PK_BUTTONS | PK_NORMAL_PRESSURE | PK_CURSOR) #define PACKETDATA ( PK_X | PK_Y | PK_BUTTONS | PK_NORMAL_PRESSURE | PK_CURSOR)
#define PACKETMODE 0 #define PACKETMODE 0
...@@ -66,6 +72,11 @@ typedef struct SDL_VideoData ...@@ -66,6 +72,11 @@ typedef struct SDL_VideoData
HANDLE d3dDLL; HANDLE d3dDLL;
IDirect3D9 *d3d; IDirect3D9 *d3d;
#endif #endif
#if SDL_VIDEO_RENDER_DDRAW
HANDLE ddrawDLL;
IDirectDraw *ddraw;
#endif
/* *INDENT-OFF* */ /* *INDENT-OFF* */
/* Function pointers for the Wacom API */ /* Function pointers for the Wacom API */
HANDLE wintabDLL; HANDLE wintabDLL;
......
...@@ -38,6 +38,41 @@ ...@@ -38,6 +38,41 @@
/* This is included after SDL_win32video.h, which includes windows.h */ /* This is included after SDL_win32video.h, which includes windows.h */
#include "SDL_syswm.h" #include "SDL_syswm.h"
#define SHFS_SHOWTASKBAR 0x0001
#define SHFS_HIDETASKBAR 0x0002
#define SHFS_SHOWSIPBUTTON 0x0004
#define SHFS_HIDESIPBUTTON 0x0008
#define SHFS_SHOWSTARTICON 0x0010
#define SHFS_HIDESTARTICON 0x0020
#ifdef _WIN32_WCE
// dynamically load aygshell dll because we want SDL to work on HPC and be300
int aygshell_loaded = 0;
BOOL(WINAPI * SHFullScreen) (HWND hwndRequester, DWORD dwState) = 0;
static BOOL
CE_SHFullScreen(HWND hwndRequester, DWORD dwState)
{
if (SHFullScreen == 0 && aygshell_loaded == 0) {
aygshell_loaded = 0;
void *lib = SDL_LoadObject("aygshell.dll");
if (lib) {
SHFullScreen =
(BOOL(WINAPI *) (HWND, DWORD)) SDL_LoadFunction(lib,
"SHFullScreen");
}
}
if (SHFullScreen) {
SHFullScreen(hwndRequester, dwState);
//printf("SHFullscreen(%i)\n",dwState);
}
}
#endif
extern HCTX *g_hCtx; /* the table of tablet event contexts, each windows has to have it's own tablet context */ extern HCTX *g_hCtx; /* the table of tablet event contexts, each windows has to have it's own tablet context */
static Uint32 highestId = 0; /* the highest id of the tablet context */ static Uint32 highestId = 0; /* the highest id of the tablet context */
...@@ -385,6 +420,7 @@ WIN_SetWindowPosition(_THIS, SDL_Window * window) ...@@ -385,6 +420,7 @@ WIN_SetWindowPosition(_THIS, SDL_Window * window)
RECT rect; RECT rect;
DWORD style; DWORD style;
HWND top; HWND top;
BOOL menu;
int x, y; int x, y;
/* Figure out what the window area will be */ /* Figure out what the window area will be */
...@@ -398,9 +434,12 @@ WIN_SetWindowPosition(_THIS, SDL_Window * window) ...@@ -398,9 +434,12 @@ WIN_SetWindowPosition(_THIS, SDL_Window * window)
rect.top = 0; rect.top = 0;
rect.right = window->w; rect.right = window->w;
rect.bottom = window->h; rect.bottom = window->h;
AdjustWindowRectEx(&rect, style, #ifdef _WIN32_WCE
(style & WS_CHILDWINDOW) ? FALSE : (GetMenu(hwnd) != menu = FALSE;
NULL), 0); #else
menu = (style & WS_CHILDWINDOW) ? FALSE : (GetMenu(hwnd) != NULL);
#endif
AdjustWindowRectEx(&rect, style, menu, 0);
if ((window->flags & SDL_WINDOW_FULLSCREEN) if ((window->flags & SDL_WINDOW_FULLSCREEN)
|| window->x == SDL_WINDOWPOS_CENTERED) { || window->x == SDL_WINDOWPOS_CENTERED) {
...@@ -425,6 +464,7 @@ WIN_SetWindowSize(_THIS, SDL_Window * window) ...@@ -425,6 +464,7 @@ WIN_SetWindowSize(_THIS, SDL_Window * window)
RECT rect; RECT rect;
DWORD style; DWORD style;
HWND top; HWND top;
BOOL menu;
int w, h; int w, h;
/* Figure out what the window area will be */ /* Figure out what the window area will be */
...@@ -438,9 +478,12 @@ WIN_SetWindowSize(_THIS, SDL_Window * window) ...@@ -438,9 +478,12 @@ WIN_SetWindowSize(_THIS, SDL_Window * window)
rect.top = 0; rect.top = 0;
rect.right = window->w; rect.right = window->w;
rect.bottom = window->h; rect.bottom = window->h;
AdjustWindowRectEx(&rect, style, #ifdef _WIN32_WCE
(style & WS_CHILDWINDOW) ? FALSE : (GetMenu(hwnd) != menu = FALSE;
NULL), 0); #else
menu = (style & WS_CHILDWINDOW) ? FALSE : (GetMenu(hwnd) != NULL);
#endif
AdjustWindowRectEx(&rect, style, menu, 0);
w = (rect.right - rect.left); w = (rect.right - rect.left);
h = (rect.bottom - rect.top); h = (rect.bottom - rect.top);
...@@ -453,6 +496,14 @@ WIN_ShowWindow(_THIS, SDL_Window * window) ...@@ -453,6 +496,14 @@ WIN_ShowWindow(_THIS, SDL_Window * window)
HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd; HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
ShowWindow(hwnd, SW_SHOW); ShowWindow(hwnd, SW_SHOW);
#ifdef _WIN32_WCE
if (window->flags & SDL_WINDOW_FULLSCREEN) {
CE_SHFullScreen(hwnd,
SHFS_HIDESTARTICON | SHFS_HIDETASKBAR |
SHFS_HIDESIPBUTTON);
}
#endif
} }
void void
...@@ -461,6 +512,14 @@ WIN_HideWindow(_THIS, SDL_Window * window) ...@@ -461,6 +512,14 @@ WIN_HideWindow(_THIS, SDL_Window * window)
HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd; HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
ShowWindow(hwnd, SW_HIDE); ShowWindow(hwnd, SW_HIDE);
#ifdef _WIN32_WCE
if (window->flags & SDL_WINDOW_FULLSCREEN) {
CE_SHFullScreen(hwnd,
SHFS_SHOWSTARTICON | SHFS_SHOWTASKBAR |
SHFS_SHOWSIPBUTTON);
}
#endif
} }
void void
...@@ -475,6 +534,14 @@ WIN_RaiseWindow(_THIS, SDL_Window * window) ...@@ -475,6 +534,14 @@ WIN_RaiseWindow(_THIS, SDL_Window * window)
top = HWND_NOTOPMOST; top = HWND_NOTOPMOST;
} }
SetWindowPos(hwnd, top, 0, 0, 0, 0, (SWP_NOMOVE | SWP_NOSIZE)); SetWindowPos(hwnd, top, 0, 0, 0, 0, (SWP_NOMOVE | SWP_NOSIZE));
#ifdef _WIN32_WCE
if (window->flags & SDL_WINDOW_FULLSCREEN) {
CE_SHFullScreen(hwnd,
SHFS_HIDESTARTICON | SHFS_HIDETASKBAR |
SHFS_HIDESIPBUTTON);
}
#endif
} }
void void
...@@ -483,6 +550,14 @@ WIN_MaximizeWindow(_THIS, SDL_Window * window) ...@@ -483,6 +550,14 @@ WIN_MaximizeWindow(_THIS, SDL_Window * window)
HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd; HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
ShowWindow(hwnd, SW_MAXIMIZE); ShowWindow(hwnd, SW_MAXIMIZE);
#ifdef _WIN32_WCE
if (window->flags & SDL_WINDOW_FULLSCREEN) {
CE_SHFullScreen(hwnd,
SHFS_HIDESTARTICON | SHFS_HIDETASKBAR |
SHFS_HIDESIPBUTTON);
}
#endif
} }
void void
...@@ -491,6 +566,14 @@ WIN_MinimizeWindow(_THIS, SDL_Window * window) ...@@ -491,6 +566,14 @@ WIN_MinimizeWindow(_THIS, SDL_Window * window)
HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd; HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
ShowWindow(hwnd, SW_MINIMIZE); ShowWindow(hwnd, SW_MINIMIZE);
#ifdef _WIN32_WCE
if (window->flags & SDL_WINDOW_FULLSCREEN) {
CE_SHFullScreen(hwnd,
SHFS_SHOWSTARTICON | SHFS_SHOWTASKBAR |
SHFS_SHOWSIPBUTTON);
}
#endif
} }
void void
...@@ -579,12 +662,18 @@ SDL_HelperWindowCreate(void) ...@@ -579,12 +662,18 @@ SDL_HelperWindowCreate(void)
return -1; return -1;
} }
HWND hWndParent = NULL;
#ifndef _WIN32_WCE
/* WinCE doesn't have HWND_MESSAGE */
hWndParent = HWND_MESSAGE;
#endif
/* Create the window. */ /* Create the window. */
SDL_HelperWindow = CreateWindowEx(0, SDL_HelperWindowClassName, SDL_HelperWindow = CreateWindowEx(0, SDL_HelperWindowClassName,
SDL_HelperWindowName, SDL_HelperWindowName,
WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, WS_OVERLAPPED, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, HWND_MESSAGE, NULL, CW_USEDEFAULT, hWndParent, NULL,
hInstance, NULL); hInstance, NULL);
if (SDL_HelperWindow == NULL) { if (SDL_HelperWindow == NULL) {
UnregisterClass(SDL_HelperWindowClassName, hInstance); UnregisterClass(SDL_HelperWindowClassName, hInstance);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment