clay/examples/GLES3-SDL2-sidebar-scrolling-container
Luke 10X 4ecba0c61a 🐞 Fix font measurement in GLES3 Clay renderer with stb font library.
- Fix incorrect font data access in Stb_MeasureText.
- Ensure that appropriate font data is used in Stb_MeasureText
  (as specified in config.fontId)
- Before this fix it was always using the data of the first font in Stb_MeasureText,
  which was not always correct.
2026-01-21 06:01:13 -05:00
..
resources [Renderers/GLES3] 📦 GLES3 renderer and demo examples using it (#565) 2025-12-30 18:52:27 +11:00
.gitignore [Renderers/GLES3] 📦 GLES3 renderer and demo examples using it (#565) 2025-12-30 18:52:27 +11:00
CMakeLists.txt [Renderers/GLES3] 📦 GLES3 renderer and demo examples using it (#565) 2025-12-30 18:52:27 +11:00
main.c 🐞 Fix font measurement in GLES3 Clay renderer with stb font library. 2026-01-21 06:01:13 -05:00
Makefile.emscripten [Renderers/GLES3] 📦 GLES3 renderer and demo examples using it (#565) 2025-12-30 18:52:27 +11:00
Makefile.macos [Renderers/GLES3] 📦 GLES3 renderer and demo examples using it (#565) 2025-12-30 18:52:27 +11:00
README.md [Renderers/GLES3] 📦 GLES3 renderer and demo examples using it (#565) 2025-12-30 18:52:27 +11:00

GLES3 Renderer Scrolling Container (Using SDL2)

This directory contains a complete example thatn can me used to test all different draw commands using work-in-progress GLES3 renderer. While it still needs refinement, the renderer is already functional and demonstrates the core rendering pipeline.

The images used as resources in this example, namely:

  • millbank.jpeg a window with a panoramic city view;
  • and profile-picture.png showing objects aligned in a circle;

are taken with my phone camera and are dedicated to the Public Domain.

How to build it with CMake?

Cmake build is the easiest way to build it:

mkdir build
cmake -S . -B ./build

How to build and run on Emscripten:

For Emscripten the build is a bit custom, but it depends on CMakeBuild to install header-stb dependency. So you still need to build it with CMake first.

And then you have to source the Emscripten SDK:

source /path/to/emscripten/emsdk/emsdk_env.sh

Then build it with hand-crafted Makefile.emscripten:

make -f Makefile.emscripten test

and then navigate to http://localhost:8080

How to build and run on Mac:

Requires SDL2:

brew install sdl2

Requires STB:

cmake -B build

Build it with:

make -f Makefile.macos

And run with:

./macos-sidebar-scrolling-container-sdl2