1
Graphics / Image set pixel & Texture update - Nothing happens?
« 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.
Any tips or alternative method?
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);
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?