Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plain Lua + FFI support #3

Closed
pocomane opened this issue Jul 12, 2016 · 1 comment
Closed

Plain Lua + FFI support #3

pocomane opened this issue Jul 12, 2016 · 1 comment

Comments

@pocomane
Copy link

It seems to me that a slight modification make this compatible with lua (not luaji) + ffifb (https://github.com/facebook/luaffifb):

index b831689..ece7b70 100644
--- a/glfw.lua
+++ b/glfw.lua
@@ -29,7 +29,6 @@
 ]]

 local ffi = require 'ffi'
-local jit = require 'jit'

 local mod = {} -- Lua module namespace
 local aux = {} -- Auxiliary utils
@@ -1042,9 +1041,12 @@ function bind_clib()
   -- Luajit does not allow to call Lua-callbacks
   -- from JIT-compiled C-functions, so we
   -- manually turn off JIT for them
-  jit.off(funcs.PollEvents)
-  jit.off(funcs.WaitEvents)
-  jit.off(funcs.WaitEventsTimeout)
+  pcall(function()
+    local jit = require 'jit'
+    jit.off(funcs.PollEvents)
+    jit.off(funcs.WaitEvents)
+    jit.off(funcs.WaitEventsTimeout)
+  end)

   -----------------------------------------------------------
   --  Extra functions
@Playermet
Copy link
Owner

Very thanks! I will do several tests and add it soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants