Go directly to github
I needed better shaders for SFML to run on mobile. This adds ES 2.0 shader support. Every render texture comes with a
setDefaultShader(sf::Shader*)
routine that allows you to define the default shader. If you don't set a default shader on mobile it will either be completely black or crash. On mobile, shaders need both fragment and vertex shader for its constructor.
Because mobile stores image data flipped by the Y axis, you must also use
flipTexture(bool flip)
if you're doing post-processing.
Besides that it's normal SFML 2.5.1. If you're on desktop those new functions won't be available. Add these checks using the
__ANDROID__
pre-processor.
sf::Texture loadingScreenSnapshot = ENGINE.GetRenderSurface().getTexture();
#ifdef __ANDROID__
loadingScreenSnapshot.flip(true);
#endif
Because the texels/s in mobile GPUs are restricted compared to desktop, making a copy of a render surface, applying post process effects, and displaying it on the same frame can choke. SFML sends a lot of stuff back and forth from GPU <-> CPU and this is costly. If SFML had a way to represent a proxy render surface by an OpenGL ID, it could skip passing the texture data over to CPU and apply shader post-effects all in the GPU before rendering to screen. This would make real-time post-processing effects possible on mobile.
I've been using this custom fork for my Open Net Battle engine. View references on using SFML for mobile
>> here <<Some videos of SFML on mobile:
SwooshLib for SFML also works with SFML 2.5.1 custom fork. Use swoosh to make professional looking games with cool shaders, screen transitions, app management, ease functions, and
more.