SFML community forums

Help => Window => Topic started by: xerzi on August 29, 2014, 08:02:44 am

Title: Getting HDC of Window?
Post by: xerzi on August 29, 2014, 08:02:44 am
Is there a way to construct a new window using the same context as another window?
Title: Re: Getting HDC of Window?
Post by: Laurent on August 29, 2014, 08:33:36 am
You can get the native window handle with window.getSystemHandle(). From there you can use any Win32/GDI function that you need (GetDC, etc.). But remember that SFML uses OpenGL. I don't know what you want to do with GDI contexts, but it may not work as expected.
Title: Re: Getting HDC of Window?
Post by: xerzi on August 29, 2014, 08:54:07 am
Well i am trying to use a single context (with all my loaded resources and such) to render to two different SFML, i'd just have to call the glMakeCurrent and SwapBuffers myself, and there'd just be an extra context created in the other sfml window?
Title: Re: Getting HDC of Window?
Post by: Laurent on August 29, 2014, 09:10:38 am
SFML contexts are all shared, you don't need to do anything.