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:
1
cwasm.h
1
cwasm.h
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user