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

Author Topic: sf::Shader::isAvailable() breaks asset use  (Read 1100 times)

0 Members and 1 Guest are viewing this topic.

DCurro

  • Newbie
  • *
  • Posts: 5
    • View Profile
sf::Shader::isAvailable() breaks asset use
« on: May 05, 2014, 12:53:33 am »
I have not done anything with shaders yet.  I merely call
sf::Shader::isAvailable()

If I remove/don't use the call, everything looks like this:
https://www.dropbox.com/s/qgctd6fkg8uz8ru/normal.png

If I use the call, everything looks like this:
https://www.dropbox.com/s/femb2d20mf4y0o7/broken.png

Remember, I am only using any sf::Shader stuff once, and it's with the sf::Shader::IsAvailable().

Using OSX, Intel i7 all the ram in the world, with the best graphics card that comes with a new Macbook pro.
« Last Edit: May 05, 2014, 01:04:36 am by DCurro »

DCurro

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: sf::Shader::isAvailable() breaks asset use
« Reply #1 on: May 05, 2014, 07:23:26 am »
I moved the query after the RenderWindow was created and it solved the problem.  I suspected that this call might have required a GLContext to have been setup.

Thanks anyways!  Hopefully this helps anyone else who has had this problem.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: sf::Shader::isAvailable() breaks asset use
« Reply #2 on: May 05, 2014, 07:48:14 am »
It does create a context if there's none. Can you please provide a complete and minimal code that reproduces the problem?
Laurent Gomila - SFML developer