]> gitweb.factorcode.org Git - factor.git/commitdiff
glfw: adding glfw-yield
authorJohn Benediktsson <mrjbq7@gmail.com>
Fri, 13 Oct 2023 17:21:51 +0000 (10:21 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Fri, 13 Oct 2023 17:21:51 +0000 (10:21 -0700)
extra/glfw/glfw.factor [new file with mode: 0644]

diff --git a/extra/glfw/glfw.factor b/extra/glfw/glfw.factor
new file mode 100644 (file)
index 0000000..098fc4a
--- /dev/null
@@ -0,0 +1,10 @@
+! Copyright (C) 2023 John Benediktsson.
+! See https://factorcode.org/license.txt for BSD license.
+USING: glfw.ffi threads ;
+IN: glfw
+
+: glfw-yield ( -- )
+    glfwGetCurrentContext
+    f glfwMakeContextCurrent
+    yield
+    glfwMakeContextCurrent ;