SFML community forums

Help => General => Topic started by: nbd on February 26, 2014, 09:57:05 pm

Title: Rendering without RenderWindow
Post by: nbd on February 26, 2014, 09:57:05 pm
Hi,

I have some obscure problem with RenderWindow object (http://en.sfml-dev.org/forums/index.php?topic=14468.0 (http://en.sfml-dev.org/forums/index.php?topic=14468.0)). Is it possible to render SFML graphic objects and vertex arrays without using RenderWindow into usual HWND?
Title: Re: Rendering without RenderWindow
Post by: MadMartin on February 26, 2014, 10:09:25 pm
No, that's not possible..... unless you create a device context and a rendering context for the HWND and setup the correct pixeldescriptor for Windows and OpenGL and use the wgl-functions and all the other platform-dependent stuff.

Which would make SFML useless/obsolete.

Why do you want to mess around with WinAPI internals while using SFML? What kind of problem are you trying to solve?
Title: Re: Rendering without RenderWindow
Post by: nbd on February 26, 2014, 10:33:35 pm
I have a "general purpose" test application where I test rendering not only using SFML and wanted to render in this application's window without creating a separate SFML window. But I see that it's probably easier to draw in a separate window. Thanks for the reply.
Title: Re: Rendering without RenderWindow
Post by: Nexus on February 26, 2014, 11:02:20 pm
You can construct sf::Window and sf::RenderWindow from a window handle as well as extract the window handle from them. Please consult the documentation for detailed information.