Used __builtin_wasm_memory_size(0) instead of having the Javascript code call init_mem with the initial page count. Added a simple <div> below the canvas that can hold any number of labels that can be filled/updated through jsSetLabel which lives in a new file misc_functions.js.
This commit is contained in:
@@ -158,6 +158,11 @@ WASM_EXPORT(App_Initialize) bool App_Initialize()
|
||||
PrintLine_D("GL_VERSION: \"%s\"", jsGlGetParameterString(scratch, GL_VERSION));
|
||||
PrintLine_D("GL_VENDOR: \"%s\"", jsGlGetParameterString(scratch, GL_VENDOR));
|
||||
|
||||
#if 1
|
||||
SetLabelPrint("glVersionLabel", "GL_VERSION: %s", jsGlGetParameterString(scratch, GL_VERSION));
|
||||
SetLabelPrint("glVendorLabel", "GL_VENDOR: %s", jsGlGetParameterString(scratch, GL_VENDOR));
|
||||
#endif
|
||||
|
||||
jsGlEnable(GL_BLEND);
|
||||
jsGlBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
jsGlBlendEquation(GL_FUNC_ADD);
|
||||
@@ -401,6 +406,9 @@ WASM_EXPORT(App_UpdateAndRender) bool App_UpdateAndRender(r64 programTimeR64)
|
||||
jsGlDrawArrays(GL_TRIANGLES, 0, 6);
|
||||
}
|
||||
|
||||
SetLabelPrint("offsetLabel", "Offset: %f", OscillateBy(programTime, -1.0f, 1.0f, 15000, 0));
|
||||
SetLabelPrint("memoryLabel", "Mem: %u pages", stdCurrentPageCount);
|
||||
|
||||
#if 1
|
||||
{
|
||||
r32 offsetX = -0.4f;
|
||||
|
||||
Reference in New Issue
Block a user