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

Author Topic: Unhandled exception with using static sf::Texture  (Read 1404 times)

0 Members and 1 Guest are viewing this topic.

diego997

  • Newbie
  • *
  • Posts: 21
    • View Profile
Unhandled exception with using static sf::Texture
« on: December 22, 2012, 07:29:10 pm »
Hello I need to have sf::Texture static code looks almost like that:

class MyClass
{
static sf::Texture Texture;

};
sf::Texture MyClass::Texture; //Here is an error I think, Unhandled exception at 0x77c32262
 

Do you guys know whats going on ?
« Last Edit: December 22, 2012, 08:51:59 pm by Laurent »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Unhandled exception with using static sf::Texture
« Reply #1 on: December 22, 2012, 08:52:28 pm »
You can't declare an instance of this class at global scope.
Laurent Gomila - SFML developer

diego997

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Unhandled exception with using static sf::Texture
« Reply #2 on: December 22, 2012, 09:19:18 pm »
so in other words, this class can not be static ?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Unhandled exception with using static sf::Texture
« Reply #3 on: December 22, 2012, 10:46:07 pm »
This instance of the class cannot be static, yes.
Laurent Gomila - SFML developer

 

anything