SDL_WINDOWID hack for win32

Hello,

I am working at the EiffelSDL project (http://eiffelsdl.sf.net) and
right now working on a Widget for SDL. I already made one for Linux
(GTK), and with the SDL_WINDOWID hack it worked quite good. Now I’m
trying to do the same for windows. But either the environment variable
is not read by SDL, or I have a completly other problem.
But I always get a separate window for SDL…
As reference I took a demo that actually had this working, but was
written in Visual Studio and set the variable with _putenv…
Has anyone alreay a working implementation of SDL in a Windows (GDI)
window? Or in a GTK window, running under windows?

I actually don’t know if the problem is really the setting of the
environment variable, but don’t know what else it could be…

Thanks for your help and tell me what information you need from me,–
Yann M?ller <@Yann_Muller>
ETH Z?rich

Hello,

I am working at the EiffelSDL project (http://eiffelsdl.sf.net) and
right now working on a Widget for SDL. I already made one for Linux
(GTK), and with the SDL_WINDOWID hack it worked quite good. Now I’m
trying to do the same for windows. But either the environment variable
is not read by SDL, or I have a completly other problem.
But I always get a separate window for SDL…
As reference I took a demo that actually had this working, but was
written in Visual Studio and set the variable with _putenv…
Has anyone alreay a working implementation of SDL in a Windows (GDI)
window? Or in a GTK window, running under windows?

I actually don’t know if the problem is really the setting of the
environment variable, but don’t know what else it could be…

Try setting the environment variable at a command line and then running
the application from there and see if that works…

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

You may need to actually provide a WinMain and set the environment variable
before you do any of the SDL initialization that is done in SDL_win32_main.c
Please let me know if that fixes things.

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

Sam Lantinga wrote:

Hello,

I am working at the EiffelSDL project (http://eiffelsdl.sf.net) and
right now working on a Widget for SDL. I already made one for Linux
(GTK), and with the SDL_WINDOWID hack it worked quite good. Now I’m
trying to do the same for windows. But either the environment variable
is not read by SDL, or I have a completly other problem.
But I always get a separate window for SDL…
As reference I took a demo that actually had this working, but was
written in Visual Studio and set the variable with _putenv…
Has anyone alreay a working implementation of SDL in a Windows (GDI)
window? Or in a GTK window, running under windows?

I actually don’t know if the problem is really the setting of the
environment variable, but don’t know what else it could be…

Try setting the environment variable at a command line and then running
the application from there and see if that works…

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

And don’t forget the _putenv(“SDL_VIDEODRIVER=windib”), that fixed it
for me.