From: Brendan Hansen Date: Tue, 2 Mar 2021 03:19:42 +0000 (-0600) Subject: added webgl functionality X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=0051def6a93c47083870c6a42a66c6b2bb803625;p=onyx.git added webgl functionality --- diff --git a/core/js/webgl.js b/core/js/webgl.js index a8e727df..4c483c9d 100644 --- a/core/js/webgl.js +++ b/core/js/webgl.js @@ -228,6 +228,7 @@ WebGl_Wasm = { }, sampleCoverage(value, invert) { this.gl.sampleCoverage(value, invert); }, scissor(x, y, width, height) { this.gl.scissor(x, y, width, height); }, + setSize(width, height) { this.canvas.width = width; this.canvas.height = height; }, shaderSource(shader, source, sourcelen) { const decoder = new TextDecoder(); const str = new Int8Array(WASM_MEMORY.buffer, source, sourcelen); diff --git a/core/js/webgl.onyx b/core/js/webgl.onyx index b1fa9c2b..8ebabfd2 100644 --- a/core/js/webgl.onyx +++ b/core/js/webgl.onyx @@ -743,7 +743,7 @@ blendFunc :: (sfactor: GLenum, dfactor: GLenum) -> void #fo blendFuncSeparate :: (srcRGB: GLenum, dstRGB: GLenum, srcAlpha: GLenum, dstAlpha: GLenum) -> void #foreign "gl" "blendFuncSeparate" --- blitFramebuffer :: (sx0: GLint, sy0: GLint, sx1: GLint, sy1: GLint, dx0: GLint, dy0: GLint, dx1: GLint, dy1: GLint, mask: GLbitfield, filter: GLenum) -> void #foreign "gl" "blitFramebuffer" --- bufferDataWithData :: (target: GLenum, buffer: [] void, usage: GLenum) -> void #foreign "gl" "bufferDataWithData" --- -bufferDataNoData :: (target: GLenum, size: GLsizeiptr, usage: GLenum) -> void #foreign "gl" "bufferDataNoData" --- +bufferDataNoData :: (target: GLenum, size: GLsizei, usage: GLenum) -> void #foreign "gl" "bufferDataNoData" --- bufferData :: proc { bufferDataWithData, bufferDataNoData } bufferSubData :: (target: GLenum, offset: GLsizei, data: [] void) -> void #foreign "gl" "bufferSubData" --- canvasSize :: (width: GLsizei, height: GLsizei) -> void #foreign "gl" "canvasSize" --- @@ -822,6 +822,7 @@ readPixels :: (x: GLint, y: GLint, width: GLsizei, height: G renderbufferStorageMultisample :: (target: GLenum, samples: GLsizei, internalforamt: GLenum, width: GLsizei, height: GLsizei) -> void #foreign "gl" "renderbufferStorageMultisample" --- sampleCoverage :: (value: GLclampf, invert: GLboolean) -> void #foreign "gl" "sampleCoverage" --- scissor :: (x: GLint, y: GLint, width: GLsizei, height: GLsizei) -> void #foreign "gl" "scissor" --- +setSize :: (width: GLint, y: GLint) -> void #foreign "gl" "setSize" --- shaderSource :: (shader: GLShader, source: str) -> void #foreign "gl" "shaderSource" --- stencilFunc :: (func: GLenum, ref: GLint, mask: GLuint) -> void #foreign "gl" "stencilFunc" --- stencilFuncSeparate :: (face: GLenum, func: GLenum, ref: GLint, mask: GLuint) -> void #foreign "gl" "stencilFuncSeparate" ---