Mfc + sdl

I have an MFC which uses SDL for rendering, but the
SDL render window pops up as a seperate window as opposed
to being in the client area of the MFC application. How do
I go about fixing this?

Thanks,
Shawn

I have an MFC which uses SDL for rendering, but the
SDL render window pops up as a seperate window as opposed
to being in the client area of the MFC application. How do
I go about fixing this?

Before you initialize the SDL video mode, you need to put the Win32 window
handle for your MFC client area into the SDL_WINDOWID environment variable,
using the _putenv() call.

Yes, this is a hack. :slight_smile: Please let me know if it works for you!

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

I can’t get it to work. I would suppose it’s pretty straightforward like:

    _putenv("SDL_WINDOWID=<number>");

Does have to be decimal, hexadecimal? If hex, should it be
"0xffffffff" or just “ffffffff”?

Shawn> ----- Original Message -----

From: slouken@devolution.com (Sam Lantinga)
To:
Sent: Monday, August 26, 2002 11:10 AM
Subject: Re: [SDL] MFC + SDL

I have an MFC which uses SDL for rendering, but the
SDL render window pops up as a seperate window as opposed
to being in the client area of the MFC application. How do
I go about fixing this?

Before you initialize the SDL video mode, you need to put the Win32 window
handle for your MFC client area into the SDL_WINDOWID environment
variable,
using the _putenv() call.

Yes, this is a hack. :slight_smile: Please let me know if it works for you!

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


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

I can’t get it to work. I would suppose it’s pretty straightforward like:

    _putenv("SDL_WINDOWID=<number>");

Does have to be decimal, hexadecimal? If hex, should it be
"0xffffffff" or just “ffffffff”?

It can be either decimal or hexidecimal with a leading 0x

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