SFML community forums

Help => Window => Topic started by: Firefly on February 19, 2010, 02:59:36 am

Title: Multiple Windows
Post by: Firefly on February 19, 2010, 02:59:36 am
I'm wondering if SFML can handle the creation of two or more windows?

I need to create two windows and thus get two window handles (HWND) so that I can pass these to my DirectX renderer which uses them to setup SwapChains for multi-monitor/window rendering.

It isn't possible with SDL, but I'm *hoping* it can be done with SFML.
Title: Multiple Windows
Post by: Laurent on February 19, 2010, 09:21:36 am
It is possible to have multiple windows, but SFML windows are meant for OpenGL rendering. And, they don't give access to their internal HWND (but you can easily hack the code to make it accessible).

If you want to use DirectX, why don't you create your windows with Win32 code directly, or using DXUT?
Title: Multiple Windows
Post by: Firefly on February 22, 2010, 05:25:14 am
Because I am creating a cross-platform engine and don't want to handle the window creation myself. Therefore I'd need access to the HWND's to send to my DX renderer, etc.
Title: Multiple Windows
Post by: Tank on February 22, 2010, 11:07:26 am
A cross-platform engine with DirectX? Sounds weird. ;)
Title: Multiple Windows
Post by: dunce on February 22, 2010, 03:00:00 pm
I presume he meant graphic API-independent engine using some SFML functionality.
Title: Multiple Windows
Post by: Firefly on February 22, 2010, 11:11:19 pm
Yes that is what I meant. I will have a DX renderer and an OGL renderer, or whatever else - it uses an API independent plugin system.

But anyway, apparently with some hacks I can get the HWND's? If I end up going down the track of supporting dual monitors then I might give it a go.

Thanks.