SFML community forums

Help => Graphics => Topic started by: terabin on May 23, 2018, 10:24:31 pm

Title: Image set pixel & Texture update - Nothing happens?
Post by: terabin on May 23, 2018, 10:24:31 pm
I'm trying to edit the pixels of a particular image, but the image does not change, it remains the same.

                sf::Vector2u size = internalImage[i].image->getSize();

                for (int x = 0; x < size.x; x++) {
                        for (int y = 0; y < size.y; y++) {
                                internalImage[i].image->setPixel(x, y, sf::Color(0, 0, 0, 255));;
                        }
                }

                internalTexture[t].texture->update(*internalImage[i].image);

Any tips or alternative method?
Title: Re: Image set pixel & Texture update - Nothing happens?
Post by: eXpl0it3r on May 23, 2018, 10:54:50 pm
You're setting the image to black and it's not changing to black?

Use a debugger and check that you're picking the right image and texture and render the correct texture, etc.