Fix WebGL2 for web build (raylib 5 requires VAOs)

Add -sUSE_WEBGL2=1 -sMIN_WEBGL_VERSION=2 -sMAX_WEBGL_VERSION=2 to both
EMCC_CFLAGS and linker flags. raylib 5.x enables VAOs by default which
require WebGL2; without it glVertexAttribPointer fails on the clientside
property of an undefined VAO object.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-07 00:39:03 +01:00
parent 951bd51f12
commit c5c1436bc7
2 changed files with 5 additions and 3 deletions

View File

@@ -7,5 +7,7 @@ rustflags = [
"-C", "link-arg=-sWASM=1",
"-C", "link-arg=-sALLOW_MEMORY_GROWTH=1",
"-C", "link-arg=-sINITIAL_MEMORY=67108864",
"-C", "link-arg=-sFULL_ES3=1",
"-C", "link-arg=-sUSE_WEBGL2=1",
"-C", "link-arg=-sMIN_WEBGL_VERSION=2",
"-C", "link-arg=-sMAX_WEBGL_VERSION=2",
]