Added texture related functions to gl_functions.js
This commit is contained in:
14
data/main.js
14
data/main.js
@@ -23,14 +23,6 @@ function AcquireCanvas(canvasWidth, canvasHeight)
|
||||
appGlobals.canvas = canvas;
|
||||
}
|
||||
|
||||
function CreateGlContext()
|
||||
{
|
||||
var canvasContextGl = appGlobals.canvas.getContext("webgl2");
|
||||
if (canvasContextGl === null) { console.error("Unable to initialize WebGL render context. Your browser or machine may not support it :("); return null; }
|
||||
// console.dir(canvasContextGl);
|
||||
appGlobals.glContext = canvasContextGl;
|
||||
}
|
||||
|
||||
async function LoadWasmModule(wasmFilePath, initialWasmPageCount)
|
||||
{
|
||||
appGlobals.textDecoder = new TextDecoder("utf-8");
|
||||
@@ -50,7 +42,11 @@ async function MainLoop()
|
||||
{
|
||||
console.log("Initializing WebGL Canvas...");
|
||||
AcquireCanvas(600, 400);
|
||||
CreateGlContext();
|
||||
|
||||
var canvasContextGl = appGlobals.canvas.getContext("webgl2");
|
||||
if (canvasContextGl === null) { console.error("Unable to initialize WebGL render context. Your browser or machine may not support it :("); return; }
|
||||
// console.dir(canvasContextGl);
|
||||
appGlobals.glContext = canvasContextGl;
|
||||
|
||||
console.log("Loading WASM Module...");
|
||||
await LoadWasmModule("app.wasm", 4);
|
||||
|
||||
Reference in New Issue
Block a user