Hi!
On one of my Android devices (Lenovo K10a40, Android 6.0) a RenderTexture is not displayed on the screen. At all.
The following minimal example is enough to reproduce the issue:
#include <SFML/Graphics.hpp>
#include <SFML/System.hpp>
int main(int argc, char* argv[])
{
sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window", sf::Style::Fullscreen);
sf::RenderTexture texture;
if (!texture.create(500, 500))
return -1;
sf::CircleShape shape(50);
shape.setFillColor(sf::Color::White);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
if (event.type == sf::Event::Resized)
{
sf::Vector2f size(
static_cast<float>(event.size.width),
static_cast<float>(event.size.height));
window.setView({{}, size});
}
}
texture.clear(sf::Color::Red);
texture.draw(shape);
texture.display();
window.clear();
window.draw(shape); // visible
window.draw(sf::Sprite(texture.getTexture())); // invisible
window.display();
}
}
The code is almost the same as in the reference:
https://www.sfml-dev.org/documentation/2.4.2/classsf_1_1RenderTexture.php.
I have added an extra draw call to put the shape below the texture, it is visible as if there were no anything else. So there is just a circle on a black screen.
What can be wrong?