Hey guys,
I try to load a texture from an image, set it to a sprite and draw it on the screen.
The image gets created and the colors are set "by hand", however the sprite always is white, no matter which color I set.
blockImage.create(BLOCK_SIZE, BLOCK_SIZE);
for(size_t x = 0; x != BLOCK_SIZE; ++x)
for(size_t y = 0; y != BLOCK_SIZE; ++y)
blockImage.setPixel(x, y, sf::Color::Blue);
blockTexture.loadFromImage(blockImage);
block.setTexture(blockTexture);
blockImage, blockTexture and block (the sprite) are members of a class and this class is stored in a std::vector in another one (maybe it has something to do with it)
I tried to print out blockImage.getPixel(0, 0).b after I set it to blue, but I get no number, so I think I make something wrong with the image, but what is it?
Thanks and Greetings