Windows CE patches for SDL 1.3 (here comes DirectDraw)

Yesterday I had failed to send that email because of the 40kb list
limit. So here it comes in 3 parts:

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

-------------- next part --------------
A non-text attachment was scrubbed…
Name: wince_events_window_fixes.patch
Type: text/x-patch
Size: 6619 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20090529/b814315f/attachment.bin
-------------- next part --------------
A non-text attachment was scrubbed…
Name: wince_renderers_system.patch
Type: text/x-patch
Size: 4306 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20090529/b814315f/attachment-0001.bin

part 2
The DirectDraw renderer
-------------- next part --------------
A non-text attachment was scrubbed…
Name: SDL_ceddrawrender.c
Type: text/x-csrc
Size: 23479 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20090529/9d6e05f0/attachment.c
-------------- next part --------------
A non-text attachment was scrubbed…
Name: SDL_ceddrawrender.h
Type: text/x-chdr
Size: 1049 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20090529/9d6e05f0/attachment.h

part 3
The gapi renderer
-------------- next part --------------
A non-text attachment was scrubbed…
Name: SDL_gapirender.c
Type: text/x-csrc
Size: 17564 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20090529/58bf554f/attachment.c
-------------- next part --------------
A non-text attachment was scrubbed…
Name: SDL_gapirender.h
Type: text/x-chdr
Size: 1095 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20090529/58bf554f/attachment.h
-------------- next part --------------
A non-text attachment was scrubbed…
Name: SDL_gapirender_c.h
Type: text/x-chdr
Size: 3951 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20090529/58bf554f/attachment-0001.h

Thanks Stefan. This is something I wanted to do but I was never motivated
enough to code it.
Fortunately you have provided a directdraw backend and it will be very
useful in futur because
we won’t be allowed to use gapi in windows CE 6.5.

Thanks again.On Fri, 29 May 2009 09:49:08 +0200, Stefan Klug <klug.stefan at gmx.de> wrote:

part 3
The gapi renderer

Okay, thanks for the patches! I’ve cleaned them up, fixed building on
Windows, reformatted with indent, and applied them!

Do you know if the DirectDraw renderer would be useful for non-mobile
platforms?

I’d love to hear more about your mingw32 Windows CE build and test
environment. If I can set it up on Mac OS X, I could potentially test and
fix build issues in advance.

Thanks!
–SamOn Fri, May 29, 2009 at 12:46 AM, Stefan Klug <klug.stefan at gmx.de> wrote:

Yesterday I had failed to send that email because of the 40kb list limit.
So here it comes in 3 parts:

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


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Okay, thanks for the patches! I’ve cleaned them up, fixed building on
Windows, reformatted with indent, and applied them!

Do you know if the DirectDraw renderer would be useful for non-mobile
platforms?

I’d love to hear more about your mingw32 Windows CE build and test
environment. If I can set it up on Mac OS X, I could potentially test
and
fix build issues in advance.

cegcc is broken for a few days and especially on MacOS but once it’s fixed
I will give you instructions.
Just need to test on Mac because usually I use it on linux or windows.On Wed, 3 Jun 2009 07:16:06 -0700, Sam Lantinga wrote:

Hi,

I am working on VisualCE project and I hope that VisualC project is up to
date because
I am starting from it.
Now when I compile I have the following issues :
e_log.c
c:\cygwin-1.7\home\vincent\projects\sdl-1.3\src\libm\math_private.h(22) :
fatal error C1083: Cannot open include file: ‘sys/types.h’: No such file or
directory

I have protected it like that :
in math_private.h :

  • #ifndef _WIN32_WCE
    #include <sys/types.h>
    +#endif

Then

c:\cygwin-1.7\home\vincent\projects\sdl-1.3\src\video\win32\SDL_win32video.h(37)
: fatal error C1083: Cannot open include file: ‘d3d9.h’: No such file or
directory

Don’t really know if SDL_win32window.c is supposed to be compiled on wince
because there are
some references to Desktop DirectDraw(IDirect3D9) :

typedef struct SDL_VideoData
{
#if SDL_VIDEO_RENDER_D3D
HANDLE d3dDLL;
IDirect3D9 *d3d;
#endif

}

Does it mean on wince we need to undef SDL_VIDEO_RENDER_D3D but in this
case dont’t understand
where is Stefan’s patch supposed to implement ddraw mobile renderer.On Wed, 3 Jun 2009 07:16:06 -0700, Sam Lantinga wrote:

Okay, thanks for the patches! I’ve cleaned them up, fixed building on
Windows, reformatted with indent, and applied them!

The latest snapshot http://www.libsdl.org/tmp/SDL-1.3.zip, has Stefan’s
patches.On Wed, Jun 3, 2009 at 12:27 PM, Vincent R. wrote:

On Wed, 3 Jun 2009 07:16:06 -0700, Sam Lantinga wrote:

Okay, thanks for the patches! I’ve cleaned them up, fixed building on
Windows, reformatted with indent, and applied them!

Hi,

I am working on VisualCE project and I hope that VisualC project is up to
date because
I am starting from it.
Now when I compile I have the following issues :
e_log.c
c:\cygwin-1.7\home\vincent\projects\sdl-1.3\src\libm\math_private.h(22) :
fatal error C1083: Cannot open include file: ‘sys/types.h’: No such file or
directory

I have protected it like that :
in math_private.h :

  • #ifndef _WIN32_WCE
    #include <sys/types.h>
    +#endif

Then

c:\cygwin-1.7\home\vincent\projects\sdl-1.3\src\video\win32\SDL_win32video.h(37)
: fatal error C1083: Cannot open include file: ‘d3d9.h’: No such file or
directory

Don’t really know if SDL_win32window.c is supposed to be compiled on wince
because there are
some references to Desktop DirectDraw(IDirect3D9) :

typedef struct SDL_VideoData
{
#if SDL_VIDEO_RENDER_D3D
HANDLE d3dDLL;
IDirect3D9 *d3d;
#endif

}

Does it mean on wince we need to undef SDL_VIDEO_RENDER_D3D but in this
case dont’t understand
where is Stefan’s patch supposed to implement ddraw mobile renderer.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

I have checked your link and SVN repository and I am blind or you are a
magician because
I couldn’t find any references to DDSURFACEDESC for instance or some other
characteristics structure.
So I want to trust you but show me explicitely WHERE …On Fri, 5 Jun 2009 06:46:25 -0700, Sam Lantinga wrote:

The latest snapshot http://www.libsdl.org/tmp/SDL-1.3.zip, has Stefan’s
patches.

Argh, sorry. I had to make some final tweaks and the commits were still
pending.

It’s all checked now, at revision 4536.

See ya,
–SamOn Fri, Jun 5, 2009 at 10:17 AM, Vincent R. wrote:

On Fri, 5 Jun 2009 06:46:25 -0700, Sam Lantinga <@slouken> wrote:

The latest snapshot http://www.libsdl.org/tmp/SDL-1.3.zip, has Stefan’s
patches.
I have checked your link and SVN repository and I am blind or you are a
magician because
I couldn’t find any references to DDSURFACEDESC for instance or some other
characteristics structure.
So I want to trust you but show me explicitely WHERE …


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Sam Lantinga schrieb:

Okay, thanks for the patches! I’ve cleaned them up, fixed building on
Windows, reformatted with indent, and applied them!
Great to hear that.
I’ve been on vacation for one week, so I’m not completely up to date.

Do you know if the DirectDraw renderer would be useful for non-mobile
platforms?
I don’t have any speed comparisons between direct draw and direct 3d,
but I expect d3d to be well optimized on win32. The ddraw renderer is
still in a early stage. Therefore I wouldn’t add another renderer to
win32 for the sake of non-confused SDL users :wink:

I’d love to hear more about your mingw32 Windows CE build and test
environment. If I can set it up on Mac OS X, I could potentially test
and fix build issues in advance.

As Vincent already noted, the ming32ce environement is still a bit
fragile and needs some manual tweaking…
I hope that it will stabilize in the near future.

Stefan

Do you know if the DirectDraw renderer would be useful for non-mobile
platforms?

I don’t have any speed comparisons between direct draw and direct 3d, but I
expect d3d to be well optimized on win32. The ddraw renderer is still in a
early stage. Therefore I wouldn’t add another renderer to win32 for the sake
of non-confused SDL users :wink:

SDL 1.2 used DirectDraw on Windows in the past, but since DirectDraw
was deprecated, when you request it, you get a shim that uses Direct3D
to implement it. That is ok and works well, as long as you’ve got 3D
hardware, and if you didn’t well… That’s why SDL uses GDI, which is
slower in theory, but in practice is more uniform (works well enough
in all configurations, and on a modern fast computer, is fast enough).On Mon, Jun 8, 2009 at 4:53 AM, Stefan Klug<klug.stefan at gmx.de> wrote:


http://pphaneuf.livejournal.com/