Added an asynchronous resource loading mechanism through App_GetResourcePath and App_ResourceLoaded. Added stb_image.h and used it to parse a .png file loaded from the server and upload it to app.testTexture. There is some ugliness around the edges images with transparency, probably caused by something pre-multiplied alpha related.

This commit is contained in:
2025-09-02 11:43:19 -07:00
parent 1a9775d670
commit f2d590be13
7 changed files with 8166 additions and 1 deletions

View File

@@ -133,6 +133,10 @@ export function jsGlBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha)
{
appGlobals.glContext.blendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
}
export function jsGlBlendEquation(equation)
{
appGlobals.glContext.blendEquation(equation);
}
export function jsGlDepthFunc(depthFunc)
{
@@ -203,6 +207,11 @@ export function jsGlBindTexture(target, textureId)
appGlobals.glContext.bindTexture(target, texture);
}
export function jsGlPixelStorei(parameter, value)
{
appGlobals.glContext.pixelStorei(parameter, value);
}
export function jsGlTexImage2D(target, level, internalFormat, width, height, border, format, type, dataLength, dataPntr)
{
let dataBuffer = new Uint8Array(appGlobals.memDataView.buffer, dataPntr, dataLength);
@@ -563,6 +572,7 @@ export let jsGlFunctions = {
jsGlDisable: jsGlDisable,
jsGlBlendFunc: jsGlBlendFunc,
jsGlBlendFuncSeparate: jsGlBlendFuncSeparate,
jsGlBlendEquation: jsGlBlendEquation,
jsGlDepthFunc: jsGlDepthFunc,
jsGlFrontFace: jsGlFrontFace,
jsGlDeleteBuffer: jsGlDeleteBuffer,
@@ -573,6 +583,7 @@ export let jsGlFunctions = {
jsGlCreateTexture: jsGlCreateTexture,
jsGlActiveTexture: jsGlActiveTexture,
jsGlBindTexture: jsGlBindTexture,
jsGlPixelStorei: jsGlPixelStorei,
jsGlTexImage2D: jsGlTexImage2D,
jsGlTexParameteri: jsGlTexParameteri,
jsGlGenerateMipmap: jsGlGenerateMipmap,