Add cAllocMem to cwasm.c which the javascript side can use to allocate memory from an opaque Arena pointer that was passed to it. Used this to implement jsGlGetParameterString, jsGlGetShaderInfoLog, and jsGlGetProgramInfoLog in gl_functions.js. Added NotNull macro and fixed bug in ScratchBegin macro. Added a bool return for App_Initialize which allows us to stop the main loop from beginning (which prevents log spew when something goes wrong)

This commit is contained in:
2025-09-01 21:53:24 -07:00
parent 7c61189d3a
commit b62f0d279b
10 changed files with 135 additions and 18 deletions

View File

@@ -129,6 +129,7 @@ Description:
#define Assert(condition) sizeof(condition) //do nothing, but make sure anything used in condition is not treated as "unused" when assertions are disabled
#define AssertMsg(condition, message) sizeof(condition)
#endif
#define NotNull(expression) Assert((expression) != nullptr)
//Actual Value of Pi: 3.1415926535897932384626433832795...
#define Pi64 3.14159265358979311599796346854 //accurate to 15 digits