updating opengl modules
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Thu, 16 Dec 2021 22:52:34 +0000 (16:52 -0600)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Thu, 16 Dec 2021 22:52:34 +0000 (16:52 -0600)
modules/glfw3/module.onyx
modules/glfw3/onyx_glfw3.c
modules/glfw3/onyx_glfw3.so
modules/opengles/module.onyx
modules/opengles/onyx_opengles.c
modules/opengles/onyx_opengles.so

index f8922c0c5cad38f7409449b528159dc737ef78bf..d425f612c41142a59f4105ceb1c3a657af4bbfa4 100644 (file)
@@ -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?
index 0a7e2c5b1c13ac89604360ca3f49b5ada537d4b8..cf84de94ad29ee1d0882771b9d13b1668951e3a5 100644 (file)
@@ -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
+};
index f41064aa2453daa874cc96e54dc8504913ed0b44..f6e354bb1fdade5d43e982e4434db86929f2eaab 100755 (executable)
Binary files a/modules/glfw3/onyx_glfw3.so and b/modules/glfw3/onyx_glfw3.so differ
index 65931bf16e3c3ee92ba68ed3a31b401a6ccdafc7..c69df44d2413bdc277340e2be72f7bd6e8c20fb0 100644 (file)
@@ -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 ---
index 5c0f41595b0240d9610125e45ab9a64bfef78701..1663b41a4215be1d54acfa5e32a4eab7431e2e46 100644 (file)
         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)
index 8500f5b362fc0a3c64ab45e1b2259504d236a2d6..71591b0922cef35fce573675c5eda80c5347170c 100755 (executable)
Binary files a/modules/opengles/onyx_opengles.so and b/modules/opengles/onyx_opengles.so differ