WinCE and SDL, revisited

It’s been awhile since I’ve coded with SDL under CE, but now that I’ve finally
got a usable Windows development machine I’m trying to dive back in.

There were very few issues compiling SDL1.2.6 for CE. :slight_smile: The only thing that
prevented it’s compilation was the block of code in Init_WGL_ARB_extensions()
under SDL_wingl.h - that stuff ought to be in an #ifdef HAVE_OPENGL block.
Checking the CVS, it still needs to be in an #ifdef block. :slight_smile: Once
compiled, both the alpha and window test programs worked properly. Albeit I
had to reduce the window size by 3/4.

Upon doing some tests I noticed a bug in sdlmain - it wasn’t diverting stdout
and stderr… that’s my fault I’m afraid, having contributed code that I
thought worked for that. Fortunately it was an easy fix; it was trying to
open “\\stderr.txt” instead of “\stderr.txt” and makes baby WinCE cry.
Checked the CVS to make sure the bug’s still present, and it is. Replace
#define _getcwd(str,len) wcscpy(str,DIR_SEPERATOR)
with
#define _getcwd(str,len) wcscpy(str,"")
and it will once again divert stderr and stdout properly.

Porting SDL_mixer was relatively easy… had the standard issues with mikmod -
needed to #define STDC, #define strcasecmp _strnicmp, and add __int64 to
the part where it figures out what to use for SLONGLONG. Also had to remove
the signal and buffer code from playmus.c and playwav.c, since WinCE doesn’t
support either. Once done, playmus and playwav worked.

Porting SDL_image was also fairly simple… looked up pre-built WinCE binares
for lpng and zlib and everything compiled. Getting showimage to work was a
little trickier, until I got stdout/stderr redirected again and it told me
that WinCE’s castrated version of WinDIB doesn’t like 32 bit depths.
Changing to 32 to 24 made everything work.

Next on my itenerary was seeing if I could get some WinCE hardware buttons(aka
"hotkeys") working under SDL. Problem - the arrow keys are not working under
CE anymore. I get keydown and keyup events for them but every single member
of SDL_keysym is set to zero. Enabling UNICODE doesn’t help. I think I
fixed this 6 months ago but forgot to submit a real bugfix. I’ll see if I
can figure out what I did and post the solution here.

Meanwhile, I hope to submit WinCE project files for SDL, SDL_mixer, and
SDL_image in a week or so.

I fixed the buttons before too, but never submitted a patch. If I
don’t see a patch go up before I find my code (later tonight, or
monday) I’ll submit a fix myself. I think the fix involved using a
different win32 function to check the keystate (maybe some kind of
extended keysym).

Tyler Montbriand wrote:

It’s been awhile since I’ve coded with SDL under CE, but now that I’ve
finally
got a usable Windows development machine I’m trying to dive back in.

There were very few issues compiling SDL1.2.6 for CE. :slight_smile: The only thing
that
prevented it’s compilation was the block of code in
Init_WGL_ARB_extensions()
under SDL_wingl.h - that stuff ought to be in an #ifdef HAVE_OPENGL block.

Checking the CVS, it still needs to be in an #ifdef block. :slight_smile: Once
compiled, both the alpha and window test programs worked properly. Albeit
I
had to reduce the window size by 3/4.

Upon doing some tests I noticed a bug in sdlmain - it wasn’t diverting
stdout
and stderr… that’s my fault I’m afraid, having contributed code that I
thought worked for that. Fortunately it was an easy fix; it was trying
to
open “\\stderr.txt” instead of “\stderr.txt” and makes baby WinCE cry.
Checked the CVS to make sure the bug’s still present, and it is. Replace
#define _getcwd(str,len) wcscpy(str,DIR_SEPERATOR)
with
#define _getcwd(str,len) wcscpy(str,"")
and it will once again divert stderr and stdout properly.

Porting SDL_mixer was relatively easy… had the standard issues with
mikmod -
needed to #define STDC, #define strcasecmp _strnicmp, and add __int64
to
the part where it figures out what to use for SLONGLONG. Also had to
remove
the signal and buffer code from playmus.c and playwav.c, since WinCE
doesn’t
support either. Once done, playmus and playwav worked.

Porting SDL_image was also fairly simple… looked up pre-built WinCE
binares
for lpng and zlib and everything compiled. Getting showimage to work was a

little trickier, until I got stdout/stderr redirected again and it told me
that WinCE’s castrated version of WinDIB doesn’t like 32 bit depths.
Changing to 32 to 24 made everything work.

Next on my itenerary was seeing if I could get some WinCE hardware
buttons(aka
"hotkeys") working under SDL. Problem - the arrow keys are not working
under
CE anymore. I get keydown and keyup events for them but every single
member> of SDL_keysym is set to zero. Enabling UNICODE doesn’t help. I think I
fixed this 6 months ago but forgot to submit a real bugfix. I’ll see if I
can figure out what I did and post the solution here.

Meanwhile, I hope to submit WinCE project files for SDL, SDL_mixer, and
SDL_image in a week or so.


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

— Tyler Montbriand wrote: > It’s been awhile
since I’ve coded with SDL under CE, but now that

I’ve finally
got a usable Windows development machine I’m trying to dive back in.

Meanwhile, I hope to submit WinCE project files for SDL, SDL_mixer,
and
SDL_image in a week or so.

That would be very much appreciated. Extremely so. I don’t normally
use Visual Studio so getting used to eMbedded Visual Tools is proving
quite a task…

Thanks again in advance for these files!________________________________________________________________________
Want to chat instantly with your online friends? Get the FREE Yahoo!
Messenger http://mail.messenger.yahoo.co.uk