The hole image already got transparent background which overwrites the texture for me, tried to create a mask just to see if the result would be different but it still ends up overwriting pixels.
Also just to be on the safe side, can you update a texture with a shape(not directly but get what pixels makes up the shape somehow?)? like how you can with a rendertexture.
Edit: I solved it (temporarily) with this(image 1 being my hole and image 2 being my texture to apply the hole to):
if (sf::Mouse::isButtonPressed(sf::Mouse::Left)){
i=0,y=0;
temp_x = sf::Mouse::getPosition(window).x, temp_y = sf::Mouse::getPosition(window).y;
loop = true;
while(loop){
while(y < 32){
while(i<32){
if(image1.getPixel(i, y) != sf::Color::Transparent){
image2.setPixel(temp_x+i, temp_y+y, sf::Color(0,0,0,0));
}
i++;
}
i=0;
y++;
}
loop = false;
}
texture1.loadFromImage(image2);
}
However copying pixel by pixel wasn't exactly what I wanted because of the speed so I would still like to find a way to do it with textures update function.