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

Author Topic: [SOLVED] How to share a texture made in SFML with an external OpenGL context?  (Read 1417 times)

0 Members and 1 Guest are viewing this topic.

tbop

  • Newbie
  • *
  • Posts: 34
    • View Profile
Hi,


I have a question regarding sharing lists (in our case just textures) with an external (not sfml) OpenGL context (rendered via a sf::RenderTexture):

Is there a proper way to share the lists with an external context?

Or do we have to get the buffer from the texture and upload it a texture of the external context and so on... But it could lead to performance issues so I'm trying to find out whether it's possible (perhaps we have to alter SFML's source code?)


Cheers!
« Last Edit: June 28, 2013, 03:32:34 pm by tbop »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: How to share a texture made in SFML with an external OpenGL context?
« Reply #1 on: June 27, 2013, 07:33:27 pm »
Get the SFML context with wglGetCurrentContext (or equivalent according to your OS), and then you can share your external context with it easily. Note that you can get any SFML context, since they are all shared internally.
Laurent Gomila - SFML developer

tbop

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: How to share a texture made in SFML with an external OpenGL context?
« Reply #2 on: June 28, 2013, 03:32:24 pm »
Ok that was pretty simple after all, cheers.

 

anything