-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
[core] No drawing on macOS Mojave until window is moved #693
Comments
Hi @alexander-matz, a workaround for this issue was added in commit 1fe6d9f by @a3f. By the way, are you using raylib-lua binding, I was porting it to raylib 2.0 but it was not ready yet... |
Hey @raysan5 , that was quick, thanks! I'm not using raylib-lua, since I'm using luajit anyways and can avoid building another .so by using the pure-ffi binding. My binding is an ffi-cdef containing a verbatim copy of the function prototypes and an (almost verbatim) copy of the defines to declare all constants as variables. It's straight up ignoring build time parameters but worked for me to jump start Raylib development within 5 minutes or so (without even requiring a compiler if you download a binary release). Here's a gist if you're interested: https://gist.github.com/alexander-matz/f8ee4eb9fdf676203d70c1e5e329a6ec Feel free to do with that whatever you like and thanks for the great library you're building! |
Hey @alexander-matz! Excuse my ignorance, I didn't know about the pure-ffi binding on LuaJIT, it's amazing! Maintaining raylib-lua binding could be quite cumbersome, tried to create a raylib-parser but there are lots of special cases... What are the downsides of using the pure-ffi alternative? All structs are supported directly? How are data pointers managed by ffi? Many thanks for sharing your raylib-lua-ffi gist! |
The LuaJIT FFI is pretty impressive and probably the closest to a "JustWorksTM" FFI I've seen in a scripting Language. Regarding your questions:
When it comes to downsides of using the LuaJIT FFI, the main issue is that you're locked into using LuaJIT. Whether that's a problem is up to the individual but this is my take on it. There's a couple of advantages coming with luaJIT:
But it also comes with it's downsides:
So there's no clear answer. The most worrying part is the (surprising) lack of outside contributions to the project, which makes me wonder how long it will be maintained. For the moment being, I like to use it as a crutch to quickly get a feel for a new library. If you're interested in the binding, you or I can put it up online and I try my best to maintain it. |
Does this work with raylib 2.5? I can't get to display any text with custom fonts |
@yago-gt you should try with latest raylib from github master branch. |
@raysan5 That's what I tried but I get a segmentation fault error when running a Lua version of the "text_raylib_fonts.c" example, it works fine if I compile with gcc and I tried a couple of other examples in Lua before and it worked ok. The line that seems to be causing the error is |
Drawing does not work on macOS mojave until the window is moved.
Pixel seems to have similar issues (documented here), so I suspect maybe glfw might be the ultimate culprit here?
Interestingly enough, using luaJIT + FFI and loading the shared library does not result in this behavior.
Linking against shared vs static does not change anything in C, however.
Below is a minimal example that works in lua (the raylib library is a shoddy pure-FFI binding that just loads the shared library and copies raylib.h, no initialization or anything happens). The equivalent code in C does not draw until the window is moved.
Any ideas on workarounds or fixes for this?
The text was updated successfully, but these errors were encountered: