Files
engine_smoke/app.md
T
2026-05-11 16:28:43 +02:00

3.0 KiB

name, lang, domain, description, tags, uses_functions, uses_types, framework, entry_point, dir_path, repo_url, e2e_checks
name lang domain description tags uses_functions uses_types framework entry_point dir_path repo_url e2e_checks
engine_smoke cpp gamedev Smoke test del stack gamedev: SDL3 + sokol_gfx + Dear ImGui. Valida que el stack compila y corre en PC (Linux/Windows desktop GL) y WASM (WebGL2 via emscripten) antes de invertir tiempo en runtime real (issue 0072a).
imgui
sdl3
sokol
gamedev
smoke
wasm
imgui main.cpp cpp/apps/engine_smoke
id cmd timeout_s
build_pc cmake --build build --target engine_smoke -j 300
id cmd timeout_s severity
smoke_self timeout 5 ./build/cpp/apps/engine_smoke/engine_smoke || test $? = 124 10 warning
id cmd timeout_s severity
build_wasm bash bash/functions/pipelines/build_wasm_cpp_app.sh engine_smoke 600 warning
id cmd severity
wasm_size_budget test -f build/wasm/engine_smoke/engine_smoke.wasm.gz && test $(stat -c%s build/wasm/engine_smoke/engine_smoke.wasm.gz) -lt 1572864 warning

engine_smoke

Primer experimento del stack gamedev (issue 0072a).

Que hace

  1. Abre ventana SDL3 1280x720 con context OpenGL.
  2. Inicializa sokol_gfx sobre ese context (GL 3.3 desktop, GLES3 en WASM).
  3. Pinta un fullscreen triangle con un fragment shader animado (gradient time-based).
  4. Pinta sobre eso un panel ImGui con FPS, tamaño de ventana y boton Quit.

Sin fn_framework, sin add_imgui_app(). CMakeLists standalone para evitar contaminar el shell desktop hasta validar el stack.

Build PC (Linux)

Desde la raiz del fn_registry:

cmake -S cpp -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --target engine_smoke -j
./build/cpp/apps/engine_smoke/engine_smoke

Build WASM

Requiere emsdk instalado y activado en el shell. Ver cpp/vendor/sokol.VENDORING.md y bash/functions/pipelines/build_wasm_cpp_app.sh.

bash bash/functions/pipelines/build_wasm_cpp_app.sh engine_smoke
# Sirve build/wasm/engine_smoke/engine_smoke.html en navegador

Budget objetivo: gzip ≤ 1.5 MB.

Stack vendoreado

  • cpp/vendor/sdl3/ — SDL3 release-3.4.8
  • cpp/vendor/sokol/ — sokol_gfx single-header pinned commit
  • cpp/vendor/imgui/ — ImGui 1.92.7 con backends imgui_impl_sdl3 + imgui_impl_opengl3

Notas de implementacion

  • Fullscreen tri via gl_VertexID (3 vertices, no VBO). Cubre todo el viewport sin atributos.
  • Uniform u_time actualizado por frame.
  • Backend ImGui = imgui_impl_opengl3 (oficial, 0 LoC custom). Compatible WebGL2 emscripten.
  • SOKOL_GLCORE desktop / SOKOL_GLES3 web — selccion compile-time.
  • setup_gfx se llama UNA VEZ tras crear el GL context. sg_setup toma sglue_environment() que lee el contexto activo.

No-objetivos (smoke)

  • No texturas reales (eso entra en 0072b).
  • No audio.
  • No input game-style.
  • No fn_framework integration.
  • No mobile (Android/iOS son issues 0072g/h).