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:
@@ -178,5 +178,5 @@ ArenaMark GetScratch1(Arena* conflictArena)
|
||||
static inline ArenaMark GetScratch() { return GetScratch1(nullptr); }
|
||||
|
||||
#define ScratchBegin1(scratchName, conflictArenaPntr) ArenaMark scratchName##Mark = GetScratch1(conflictArenaPntr); Arena* scratchName = scratchName##Mark.arena
|
||||
#define ScratchBegin(scratchName) ScratchBegin(scratchName, nullptr)
|
||||
#define ScratchBegin(scratchName) ScratchBegin1(scratchName, nullptr)
|
||||
#define ScratchEnd(scratchName) ResetToArenaMark(scratchName##Mark)
|
||||
|
||||
Reference in New Issue
Block a user