You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So basically, I tested this on Androids 6, 8, 10, and 13. On Androids 10 and 13, the program works normally and shortly after you boot up the program you get the image below. On older Androids, it seems like after calling texture.update(), the texture is sometimes (pretty much 50/50) just black, and then it breaks the recursive image... With a higher framerate, this leads to flickering (I cannot show that with an image, but I can record a video if necessary). Also compared to #2419 the texture isn't ever flipped - everything works as it should.
Your environment
Android Studio 2022.1.1 on Windows 10
SFML 2.6.x branch
Used CMake, Ninja, Android NDK 25
Steps to reproduce
#include<SFML/Graphics.hpp>intmain()
{
sf::RenderWindow window(sf::VideoMode::getDesktopMode(), "SFML works!", sf::Style::Fullscreen);
window.setFramerateLimit(10);
sf::CircleShape shape(400.f);
sf::RectangleShape shape2;
shape.setFillColor(sf::Color::Green);
shape2.setSize(sf::Vector2f(400, 400));
sf::Texture texture;
texture.create(window.getSize().x, window.getSize().y);
bool active = window.hasFocus();
while (window.isOpen())
{
sf::Event event;
bool end = 0;
while (window.pollEvent(event))
{
switch (event.type)
{
case sf::Event::Closed:
window.close();
break;
case sf::Event::LostFocus:
window.setActive(0);
active = 0;
break;
case sf::Event::GainedFocus:
window.setActive(1);
active = 1;
break;
case sf::Event::KeyReleased:
if (event.key.code == sf::Keyboard::Escape)
window.close();
break;
}
}
texture.update(window);
shape2.setTexture(&texture);
window.clear();
window.draw(shape);
window.draw(shape2);
window.display();
}
}
The text was updated successfully, but these errors were encountered:
Also, I feel like I have to add that this may not be related to the Android version at all. It is completely possible that the issue is related to something like the OpenGL ES version or EGL version or something else. That is all I know. I checked the source code for the texture.update() but nothing seems to be wrong - as I already mentioned, it works even on these older devices, just not always, something like 40 - 50% of the time.
Phones I used for testing:
Android 6 - Sony Xperia M5
Android 8 - Samsung Galaxy S7
Android 10 - Samsung Galaxy S9
Android 13 - Samsung Galaxy A72
eXpl0it3r
changed the title
sf::Texture::update() does not work properly on older Androidssf::Texture::update() does not work properly on older Androids
May 14, 2024
Subject of the issue
So basically, I tested this on Androids 6, 8, 10, and 13. On Androids 10 and 13, the program works normally and shortly after you boot up the program you get the image below. On older Androids, it seems like after calling texture.update(), the texture is sometimes (pretty much 50/50) just black, and then it breaks the recursive image... With a higher framerate, this leads to flickering (I cannot show that with an image, but I can record a video if necessary). Also compared to #2419 the texture isn't ever flipped - everything works as it should.
Your environment
Android Studio 2022.1.1 on Windows 10
SFML 2.6.x branch
Used CMake, Ninja, Android NDK 25
Steps to reproduce
The text was updated successfully, but these errors were encountered: