WinCE fixes to SDL_dibvideo.c and SDL_dibevents.c - more

Sam Lantinga wrote:

I’ve made fixes to the SDL DIB driver to allow it to fullscreen properly
under Windows CE. They require the linking of aygshell.lib when
compiling for CE.

Thanks, I added a variation of your changes to CVS.
Can you check them out and make sure they work?

See ya!
-Sam Lantinga, Software Engineer, Blizzard Entertainment


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

It works even better than my version! :slight_smile: Was a bug I’d forgotten about in my
busyness - part of the bottom bar was showing thru anyway - but you fixed it
outright somehow.

Afew more changes to SDL_dibvideo.c and SDL_dibevents.c for some new problems,
tho.

  1. Stuff in SDL_dibvideo.c: Hafta put #ifdefs around WIN_GL calls in
    DIB_SetVideoMode, 'cause HAVE_OPENGL isn’t always defined. Also, WinCE
    doesn’t have a WS_THICKFRAME flag.

////////////

#ifdef _WIN32_WCE
const DWORD resizestyle = WS_MAXIMIZEBOX;
#else
const DWORD resizestyle = (WS_THICKFRAME|WS_MAXIMIZEBOX);
#endif //_WIN32_WCE

//////////////////

#ifdef HAVE_OPENGL
/* Clean up any GL context that may be hanging around */
if ( current->flags & SDL_OPENGL ) {
WIN_GL_ShutDown(this);
}
#endif

And this one in DIB_VideoQuit()…

#ifdef HAVE_OPENGL
/* Set up for OpenGL */
if ( flags & SDL_OPENGL ) {
if ( WIN_GL_SetupWindow(this) < 0 ) {
return(NULL);
}
video->flags |= SDL_OPENGL;
}
#endif

/////////////

  1. A modification to give DIB_CreateWindow proper Unicode support…

///////////
int DIB_CreateWindow(_THIS)
{
#ifndef CS_BYTEALIGNCLIENT
#define CS_BYTEALIGNCLIENT 0
#endif
SDL_RegisterApp(“SDL_app”, CS_BYTEALIGNCLIENT, 0);
if ( SDL_windowid ) {
SDL_Window = (HWND)strtol(SDL_windowid, NULL, 0);

  /* DJM: we want all event's for the user specified
     window to be handled by SDL.
   */
  if (SDL_Window) {
     userWindowProc = (WNDPROC)GetWindowLong(SDL_Window, GWL_WNDPROC);
     SetWindowLong(SDL_Window, GWL_WNDPROC, (LONG)WinMessage);
  }

} else {
#ifdef _WIN32_WCE
{
/* WinCE uses the UNICODE version /
int nLen = strlen(SDL_Appname)+1;
LPWSTR lpszW = alloca(nLen
2);
MultiByteToWideChar(CP_ACP, 0, SDL_Appname, -1, lpszW, nLen);
SDL_Window = CreateWindow(lpszW, lpszW,
(WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX),
0,0, 0, 0, NULL, NULL, SDL_Instance, NULL);

}

#else
SDL_Window = CreateWindow(SDL_Appname, SDL_Appname,
(WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX),
0, 0, 0, 0, NULL, NULL, SDL_Instance, NULL);
#endif //_WIN32_WCE

if ( SDL_Window == NULL ) {
SDL_SetError(“Couldn’t create window”);
return(-1);
}
ShowWindow(SDL_Window, SW_HIDE);
}
return(0);
}

///////