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

Author Topic: OpenGL with no or hidden window  (Read 3414 times)

0 Members and 1 Guest are viewing this topic.

ronag

  • Newbie
  • *
  • Posts: 24
    • View Profile
OpenGL with no or hidden window
« on: September 20, 2010, 09:54:01 pm »
I'm using SMFL to do some gpgpu computing... which doesnt require a window however a ogl context is still needed.

In what ways can I run OpenGL SFML with no or someway hidden window?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
OpenGL with no or hidden window
« Reply #1 on: September 20, 2010, 10:07:53 pm »
With SFML there's always an OpenGL context activated in the main thread, you don't have to do anything.
Laurent Gomila - SFML developer

ronag

  • Newbie
  • *
  • Posts: 24
    • View Profile
OpenGL with no or hidden window
« Reply #2 on: September 20, 2010, 10:38:34 pm »
And if the main is unavailable... how do I add an ogl context to a new thread without creating a window?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
OpenGL with no or hidden window
« Reply #3 on: September 20, 2010, 11:47:02 pm »
Code: [Select]
sf::Context context;
Laurent Gomila - SFML developer

ronag

  • Newbie
  • *
  • Posts: 24
    • View Profile
OpenGL with no or hidden window
« Reply #4 on: September 21, 2010, 12:33:09 am »
Thanks. Almost there.

One last problem. How do I swap buffers using the context? It seems to create a dummy window in the background. However it is a private member and I cannot call Display on it.

ronag

  • Newbie
  • *
  • Posts: 24
    • View Profile
OpenGL with no or hidden window
« Reply #5 on: September 21, 2010, 12:46:00 am »
EDIT: Solved, I'm just overthinking things.

Thanks for the help.

 

anything