From: Brendan Hansen Date: Thu, 16 Dec 2021 22:52:34 +0000 (-0600) Subject: updating opengl modules X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=1e4504558569a9202d446fd3752ee161f358ccc9;p=onyx.git updating opengl modules --- diff --git a/modules/glfw3/module.onyx b/modules/glfw3/module.onyx index f8922c0c..d425f612 100644 --- a/modules/glfw3/module.onyx +++ b/modules/glfw3/module.onyx @@ -133,6 +133,7 @@ GLFWgammaramp :: struct { glfwWaitEventsTimeout :: (timeout: f64) -> void --- glfwPostEmptyEvent :: () -> void --- glfwSwapBuffers :: (window: GLFWwindow_p) -> void --- + glfwSetWindowSizeCallback :: (window: GLFWwindow_p, name: str) -> void --- } // This should always be defined right? diff --git a/modules/glfw3/onyx_glfw3.c b/modules/glfw3/onyx_glfw3.c index 0a7e2c5b..cf84de94 100644 --- a/modules/glfw3/onyx_glfw3.c +++ b/modules/glfw3/onyx_glfw3.c @@ -475,6 +475,9 @@ GLFW_HOOK(glfwSetCursorEnterCallback, (int entered), GLFW_HOOK(glfwSetScrollCallback, (double dx, double dy), (WASM_F64_VAL(dx), WASM_F64_VAL(dy))) + +GLFW_HOOK(glfwSetWindowSizeCallback, (int width, int height), + (WASM_I32_VAL(width), WASM_I32_VAL(height))) // // glfwSetDropCallback ONYX_DEF(glfwGetLoadProcAddress, (), (LONG)) { @@ -561,6 +564,7 @@ ONYX_LIBRARY { ONYX_FUNC(glfwSetCursorPosCallback) ONYX_FUNC(glfwSetCursorEnterCallback) ONYX_FUNC(glfwSetScrollCallback) + ONYX_FUNC(glfwSetWindowSizeCallback) ONYX_FUNC(glfwGetLoadProcAddress) // // glfwGetKeyName :: (key, scancode: i32) -> cstr --- @@ -574,4 +578,4 @@ ONYX_LIBRARY { NULL -}; \ No newline at end of file +}; diff --git a/modules/glfw3/onyx_glfw3.so b/modules/glfw3/onyx_glfw3.so index f41064aa..f6e354bb 100755 Binary files a/modules/glfw3/onyx_glfw3.so and b/modules/glfw3/onyx_glfw3.so differ diff --git a/modules/opengles/module.onyx b/modules/opengles/module.onyx index 65931bf1..c69df44d 100644 --- a/modules/opengles/module.onyx +++ b/modules/opengles/module.onyx @@ -13,7 +13,7 @@ GLGetProcAddress :: #distinct i64 // (name: cstr) -> ^void glActiveTexture :: (texture: GLenum) -> void --- glAttachShader :: (program: GLuint, shader: GLuint) -> void --- glBindAttribLocation :: (program: GLuint, index: GLuint, name: ^GLchar) -> void --- - glBindBuffer :: (target: GLenum, buffer: GLuint) -> void --- + glBindBuffer :: (target: GLenum, buffer: GLint) -> void --- glBindFramebuffer :: (target: GLenum, framebuffer: GLuint) -> void --- glBindRenderbuffer :: (target: GLenum, renderbuffer: GLuint) -> void --- glBindTexture :: (target: GLenum, texture: GLuint) -> void --- @@ -183,7 +183,7 @@ GLGetProcAddress :: #distinct i64 // (name: cstr) -> ^void glFramebufferTextureLayer :: (target: GLenum, attachment: GLenum, texture: GLuint, level: GLint, layer: GLint) -> void --- glMapBufferRange :: (target: GLenum, offset: GLintptr, length: GLsizeiptr, access: GLbitfield) -> rawptr --- glFlushMappedBufferRange :: (target: GLenum, offset: GLintptr, length: GLsizeiptr) -> void --- - glBindVertexArray :: (array: GLuint) -> void --- + glBindVertexArray :: (array: GLint) -> void --- glDeleteVertexArrays :: (n: GLsizei, arrays: ^GLuint) -> void --- glGenVertexArrays :: (n: GLsizei, arrays: ^GLuint) -> void --- glIsVertexArray :: (array: GLuint) -> GLboolean --- diff --git a/modules/opengles/onyx_opengles.c b/modules/opengles/onyx_opengles.c index 5c0f4159..1663b41a 100644 --- a/modules/opengles/onyx_opengles.c +++ b/modules/opengles/onyx_opengles.c @@ -124,6 +124,12 @@ return NULL; \ } +#define ONYX_GL_INT_PTR_RET_PTR(name, ptr_type) \ + ONYX_DEF(name, (INT, PTR), (INT)) { \ + results->data[0] = WASM_I32_VAL(glad_##name (params->data[0].of.i32, (ptr_type *) ONYX_PTR(params->data[1].of.i32))); \ + return NULL; \ + } + #define ONYX_GL_INT_2_PTR(name, ptr_type) \ ONYX_DEF(name, (INT, INT, PTR), ()) { \ glad_##name (params->data[0].of.i32, params->data[1].of.i32, (ptr_type *) ONYX_PTR(params->data[2].of.i32)); \ @@ -371,7 +377,7 @@ ONYX_GL_INT_PTR(glGenTransformFeedbacks, GLuint) ONYX_GL_INT_PTR(glGetFragDataLocation, char) ONYX_GL_INT_PTR(glVertexAttribI4iv, GLint) ONYX_GL_INT_PTR(glVertexAttribI4uiv, GLuint) -ONYX_GL_INT_PTR(glGetUniformBlockIndex, char) +ONYX_GL_INT_PTR_RET_PTR(glGetUniformBlockIndex, char) ONYX_GL_INT_3(glDrawArrays) ONYX_GL_INT_3(glStencilFunc) ONYX_GL_INT_3(glStencilOp) diff --git a/modules/opengles/onyx_opengles.so b/modules/opengles/onyx_opengles.so index 8500f5b3..71591b09 100755 Binary files a/modules/opengles/onyx_opengles.so and b/modules/opengles/onyx_opengles.so differ