My step by step guides for SDL3 to build for Android and WebAssembly

Select a fir by mouse click using glReadPixels

Demo in the browser

Tools: SDL3, Emscripten, C++, CMake, OpenGL ES 2.0, GLM, and stb_image

select-2d-fir

Click buttons with color ID using glReadPixels

Demo in the browser

This example uses the following GUI asset: Free UI Hologram Interface by Wenrexa. You can find a lot of GUI assets on itch: Top game assets tagged Graphical User Interface (GUI) - itch.io I packed the GUI textures using Free Texture Packer to one texture + JSON. RapidJSON is used to parse the JSON file.

Tools: SDL3, Emscripten, C++, CMake, OpenGL ES 2.0, GLM, stb_image, Free Texture Packer, and RapidJSON

click-buttons-with-color-id

A new version: Deploying SDL3 app on Android using SDL3-x.y.z.aar

New version for SDL 3.3: Setting Up SDL 3.3 for Android Development

Result of testing: Discord

Testing of the GitHub - madebr/sdlcross: Little SDL application buildable on Desktop + Android example with SDL3 Renderer API that shows squares when we touch the screen:
sdlcross-SDL3-Aug-14-2025

Example in pure OpenGL ES 2.0 that draws a simple green triangle:

I used the https://github.com/Genymobile/scrcpy app to create a screenshot on PC using USB cable from the phone.

Added the following info to the guide: Setting Up SDL 3.3 for Android Development

  • Important! The project name in CMakeLists.txt:
# Declare the project
project(my-project)
  • Must be the same as the project name in the .java file located at app\src\main\java\com\example\sdlcross, inside the getLibraries() method:
package com.example.sdlcross;

import org.libsdl.app.SDLActivity;

public class MyActivity extends SDLActivity {
    protected String[] getLibraries() {
        return new String[] { "my-project" };
    }
}

There is my mistake above. The executable name should be the same with the return new String[] { "sdlcross" };:

  • Important! The executable name in CMakeLists.txt:
add_executable(sdlcross src/main.c)
  • Must be the same as the project name in the .java file located at app\src\main\java\com\example\sdlcross, inside the getLibraries() method:
package com.example.sdlcross;

import org.libsdl.app.SDLActivity;

public class MyActivity extends SDLActivity {
    protected String[] getLibraries() {
        return new String[] { "sdlcross" };
    }
}

Note. The SDL 3.3 is not release yet. I call the currect master branch like 3.3.