DefOS - Extra native OS functions


#21

Pretty sure FFI isn’t available on Linux. I think I tested a few months ago and it wasn’t supported. It doesn’t work on Mac either.


#22

FFI and LuaJIT are available on all platforms except html 5 and arm64. But there’s some kind of problem when building (not bundling) from editor 2.


#24

Hi all.

I try bundling DefOS with Native Extension(for use on macOS) and receieve build error. Anyone can help?

Or maybe I can make FFI variant for macOS?


#25

Yes, but you need to share the build error.


#26

I can probably do this during next week. It would be great to get rid of the FFI stuff and only ship it as a native extension.


#27

Ok. I show error later.

And thank you for make Native Extension for Windows. Or say what need to do for Windows. I try make it.


#28

Bundle error


#29

Temporary make FFI disable cursors function for macOS.

If anyone need it add to defos.lua next code:

if ffi.os == "OSX" then
	ffi.cdef([[
			int CGDisplayHideCursor();
			int CGDisplayShowCursor();
		]])
	function M.disable_mouse_cursor()
		C.CGDisplayHideCursor()
	end
	function M.enable_mouse_cursor()
		C.CGDisplayShowCursor()
	end
end

#30

You can make for HTML5 disable cursors function too?


#31

It can be done, best way will be to use Pointer Lock API.


#32

I’ve pushed a version for windows using native extensions instead of FFI. Tested on Windows 10. It would be great if someone could try it on Win 7 or 8:

https://github.com/subsoap/defos/tree/dev/removeffi


#33

I try on Win 7 some later. Today say.

What about error in bundle process?


#34

Awesome!! I tried it on Windows 7. It builds and works fine, but when I bundle it the extension doesn’t seem to be included. I just get “attempt to index global ‘defos’ (a nil value)”. I’m using Editor 2, is that a problem, or am I missing something else?

A separate issue, I still have a weird issue with maximizing. I think I’ve narrowed it down—if, before toggling maximized or fullscreen from DefOS, I use the windows command (windows-button + up) to maximize the window, then toggle maximize from DefOS, the window vanishes completely. It doesn’t show up in the task bar or the task manager, but it’s still running and sending stuff to the editor console. The only way to stop it is to kill the dmengine.exe process from the task manager (or build from the editor again).

If I do Win+Up to maximize, then toggle fullscreen from DefOS, then toggle maximized or fullscreen back again from DefOS, it crashes.

So, if you feel like looking into it, that’s that. Now that I’ve figured out when it happens I can sort of get rid of the issue by disabling the maximize button from DefOS, though of course that’s not ideal.


#35

I repeat DefOS not bundle error in macos build.


#36

Yes, that should be an NSRect and not a CGRect. I’ve changed this. Could you please try building again?


#37

Yes. Try now.


#38

I build it, but please add fix for full version(I mean branch with Windows Native Extension).

Thank you.


#39

Oh, sorry, I thought I had already fixed that on the branch as well as on master. Try again!


#40

Thank you. All ok.


#41

Does this happen when you are using the extension from the master branch as well (ie with the Windows version running using LuaJIT FFI)?