Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Getting HDC of Window?  (Read 1828 times)

0 Members and 1 Guest are viewing this topic.

xerzi

  • Newbie
  • *
  • Posts: 15
    • View Profile
Getting HDC of Window?
« on: August 29, 2014, 08:02:44 am »
Is there a way to construct a new window using the same context as another window?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Getting HDC of Window?
« Reply #1 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.
Laurent Gomila - SFML developer

xerzi

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: Getting HDC of Window?
« Reply #2 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?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Getting HDC of Window?
« Reply #3 on: August 29, 2014, 09:10:38 am »
SFML contexts are all shared, you don't need to do anything.
Laurent Gomila - SFML developer

 

anything