SFML community forums

Help => Graphics => Topic started by: Groogy on April 01, 2012, 01:26:36 am

Title: sf::Image and sf::Texture create function messed up
Post by: Groogy on April 01, 2012, 01:26:36 am
Well the latest commit to SFML2 have messed up sf::Image and sf::Texture's create function making it impossible to create textures or images. This in it's own turn messed up the internal creation of textures and images for sf::Font so my entire example I was going to show up for rbSFML doesn't work because of that ^^

The concerning code is:
////////////////////////////////////////////////////////////
bool Texture::create(unsigned int width, unsigned int height)
{
    // Check if texture parameters are valid before creating it
    if ((m_size.x == 0) || (m_size.y == 0))
    {
        err() << "Failed to create texture, invalid size (" << m_size.x << "x" << m_size.y << ")" << std::endl;
        return false;
    }
   
    // ... more code...
}

I first thought this was a problem in rbSFML so took me some time to find it ^^
Anyway this was done with the most recent commit and is just a little mistake so thought it wasn't worth putting up on the issue tracker. Though on the odd chance that you would miss it I didn't want to just let it be left hanging for several days.


Edit: Oooh wait, seems to be only in sf::Texture. Though somehow it messes up with fonts so that it tries to create a 0x0 sf::Image so you get an error output.
Title: Re: sf::Image and sf::Texture create function messed up
Post by: Laurent on April 01, 2012, 10:01:24 am
Oops! Thank you ;D