SDL in a SDI Window

Hello!

I’m searching the web for a while but I don’t find any good explanation
how to use SDL in a SDI MFC Application. Is anyone here who is able to
explain or knows a good tutorial or something like that?

jk

Jonas Klein wrote:

Hello!

I’m searching the web for a while but I don’t find any good explanation
how to use SDL in a SDI MFC Application. Is anyone here who is able to
explain or knows a good tutorial or something like that?

jk

I created some code a while back for this purpose. It’s a bit old now,
but will still work. I have an update (complete code change actually),
but it’s not on the web yet. I will post the newer code later on when I
find out where I put it.

http://www.polplex.co.uk/~tigger/sdl/index.html

Use a form view and stick a static control on there, you can then draw
to the static control. When the view is initialised create an
"SDL_ChildWindow" using the library that uses the form view’s static
control HWND.

(use GetSafeHwnd() to get the HWND)

You can use normal SDL blits to draw to the shadow surface in the child
window.

Hope this makes sense. I’m assuming you have some experience of Win32
API and/or MFC programming. If not I can explain in more detail

  • Tom

Tom Wilson wrote:

Jonas Klein wrote:

Hello!

I’m searching the web for a while but I don’t find any good
explanation how to use SDL in a SDI MFC Application. Is anyone here
who is able to explain or knows a good tutorial or something like that?

jk

I created some code a while back for this purpose. It’s a bit old
now, but will still work. I have an update (complete code change
actually), but it’s not on the web yet. I will post the newer code
later on when I find out where I put it.

http://www.polplex.co.uk/~tigger/sdl/index.html

Use a form view and stick a static control on there, you can then draw
to the static control. When the view is initialised create an
"SDL_ChildWindow" using the library that uses the form view’s static
control HWND.

(use GetSafeHwnd() to get the HWND)

You can use normal SDL blits to draw to the shadow surface in the
child window.

Hope this makes sense. I’m assuming you have some experience of Win32
API and/or MFC programming. If not I can explain in more detail

  • Tom

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

hello tom!

thanks for your class - but i got an error while compiling:
(sorry, its in german)

In “xmemory”, a file that comes with vs7:

c:\Programme\Microsoft Visual Studio .NET 2003\Vc7\include\xmemory(34):
error C2665: ‘operator new’: Durch keine der 5 ?berladungen kann
Parameter 1 vom Typ ‘const char [67]’ konvertiert werden

which version of vc are you using?

  • jk

[SNIP]

hello tom!

thanks for your class - but i got an error while compiling:
(sorry, its in german)

In “xmemory”, a file that comes with vs7:

c:\Programme\Microsoft Visual Studio .NET 2003\Vc7\include\xmemory(34):
error C2665: ‘operator new’: Durch keine der 5 ?berladungen kann
Parameter 1 vom Typ ‘const char [67]’ konvertiert werden

which version of vc are you using?

  • jk

I use VC6, I switched on my dusty old CVS server earlier to get the
newer code, and the power supply gave out!

But now I have recovered the CVS folder from the disk. So I have the
updated code.

It’s totally different actually, but not well documented, the old code
had some bugs that stopped mouse hits registering. I have made a level
editor in MFC with this, so I know it works.

Try this and if you still have problems, then get in touch.

Hope this helps,

  • Tom

-------------- next part --------------
A non-text attachment was scrubbed…
Name: SDLToWin32.zip
Type: application/x-zip-compressed
Size: 5820 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20050330/d9db478c/attachment.bin