DefOS - Extra native OS functions


#1

Repo here: https://github.com/subsoap/defos

DefOS

Extra native OS functions for games written using the Defold game engine

Use issues for feature requests.


Big list of feature requests based on our experience on Ludum Dare
Hiding the mouse cursor (DEF-1619)
#2

This weekend or sooner I’ll work on getting Linux version working with same features. Unless anyone else with more Linux experience would like to give it a go.


#3

Really cool! Good job @Pkeod and @AGulev!


#4

Great job and thanks for the extensions!

@britzl: any chance of having a more in depth tutorial on extensions? It would be great (and learn) how to wrap one, and the thought process behind it.


#5

Have you read the manual on Native Extensions? I think that manual page covers all of the important stuff.


How to launch a game with maximized window
#6

Yes, but there are things for which my knowledge is lacking an where a “real world” tutorial might help (?)


#7

I’ll help make a practical use tutorial later if there is no tutorial later. We still need to wait until all targets get Native Extensions support. I was personally waiting on that to really use it. Sounds like it’s happening within next few weeks!

For majority of users, you will probably never develop your own Native Extensions and instead use the generic ones already made, because majority of a game can be accomplished without them, and there are only so many reasons most devs would want extra features such as implementing 3rd party 3dks for ads or using target os api /hardware features which are not already implemented in vanilla Defold engine.


#8

Got sick Friday and kind of killed my productivity. I did still spend a few hours today reading X11 docs for Linux. I think after figuring out a few issues the rest should be easy. Main issue right now is how to get the application’s Window… I can think of some hacky ways of doing it but not what seems the right way. Linux doesn’t have Native Extensions support yet, right? Might be better to wait until it does because then I can use dmGraphics::GetNativeX11Window and it’s easy.

Edit: can’t use ffi on Linux anyway so have to wait for sure?


#9

Yes, not long now. I’ll check with Sven and Mathias to confirm when.

Really? Why?


#10

If I do

```local ffi = package.preload.ffi()`

on Linux it will give error

attempt to call field ffi (a nil value)

I think same error happens on macOS right now too?


#11

New methods was added to the library :smirk_cat: :

defos.set_window_title("I set this title using Defos")
defos.toggle_fullscreen()
defos.is_fullscreen()

#12

Few more new methods:

	defos.toggle_maximize()
	defos.is_maximized()

And new example:

UPD: Thanks @britzl !!! defos.is_maximize() was replaced with defos.is_maximized(). Screenshot and readme was updated too.


How to launch a game with maximized window
#13

Wow, this extension is really developing into something super useful for those devs creating desktop games using Defold! Well done!

I pushed a fix to a typo and also added an FFI check and defaulting to the native extension if it exists.

Should it perhaps be defos.is_maximized() with a ‘d’?


#14

I think you right!
I’ll fix it right now. And thanks for your fixes!!!


#15

Hey guys, what’s the status with DefOS, now that Native Extensions work on Windows?


#16

It needs work but I’m giving attention to other projects first right now. Which features do you need?


#17

Yeah, no rush, I’m mostly just curious at the moment. Toggling fullscreen and the mouse cursor would fill my needs.


#18

Good to know that somebody want to use extension. Unfortunately I have no Windows PC to remake DefOS like an extension for Windows, but I’ll try to come up with something.


#19

Yeah, I think it’s a great extension! It’s pretty necessary for a professional desktop game.

So the Lua FFI module works perfectly on windows (why I doubted I don’t know). Is that not available on Linux? I guess it will be nice when Linux Native Extensions are released and you can use the same approach for all three.

Again, I’m not trying to nag at all, just checking out possibilities for my next project.


#20

Tried to compile example project from github and got the build error:

PC, win10
what’s wrong?

UPD: Solved by renaming/removing ext.manifest/NE