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

Author Topic: sf::GlResource for own resources  (Read 1596 times)

0 Members and 1 Guest are viewing this topic.

Robert42

  • Newbie
  • *
  • Posts: 31
    • View Profile
sf::GlResource for own resources
« on: September 18, 2011, 12:39:50 pm »
I wonder if it's a good idea to create own gl resources using sf::GlResource baseclass.

The documentation says the sf::GlResource class to be "for internal use only".

Does this mean "Bad Idea"?

I've taken a look on the source of the texture class. Are there other things to keep in Mind than calling EnsureGlContext(); before any OpenGL functions?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
sf::GlResource for own resources
« Reply #1 on: September 18, 2011, 01:19:28 pm »
I think it can safely be used for your own classes. The constructor and destructor do the job automatically, so you just have to call EnsureGlContext() before doing OpenGL calls.

It's marked "for internal use only" because it was written for my own needs, and was not supposed to be used publicly. But if you find it useful, you can use it.
Laurent Gomila - SFML developer

Robert42

  • Newbie
  • *
  • Posts: 31
    • View Profile
sf::GlResource for own resources
« Reply #2 on: September 18, 2011, 01:24:47 pm »
thx

 

anything