C++ Usage

Hey everyone,

For the past day or so, I’ve been looking to port my game from Unity over to another framework, or preferably, engine. I took a look at Defold, and I must say, I’m impressed. Documentation is great, the community is active - it’s everything I look for in a game engine.

The thing is, for a while now, I’ve been writing my own tools in C and C++, but for a commercial game, writing a full game engine is not something I’m really keen on doing; so, I was wondering if there was any way to use C++ in Defold. I’ve read a few things regarding this, from which I’ve learned that C++ is more tailored towards native extensions, but I’m asking just in case there’s some more up-to-date news. If there’s no way to do so, that’s fine; I enjoy using Lua, too, but of course, using C or C++ would be great.

Thanks in advance.

EDIT: I did find a plugin which enables you to use Haxe, which has quite a similar API to C, in Defold. Man, I’m loving this so far!

EDIT 2: Just checked back on this post, and meant to say Unity instead of MonoGame. My bad!

2 Likes

You can use c/c++ almost for everything through native extensions (there are some limitations of course). But believe me it is not necessary. It is better to handle heavy stuff with c/c++ like complex algorithms or things which require separate thread…
Docs: https://defold.com/manuals/extensions/
c Api: https://defold.com/ref/stable/dmAlign/

You can find c/c++ assets on the asset store(not all of them) https://defold.com/assets/

Also @d954mas is developing a open source 2.5 shooter by heavily using c/c++ Noname 2.5 Shooter (Open source)

6 Likes

I guess I’ll stick to Lua, then. I’m definitely going to be writing native extensions at one point, though.

3 Likes

Welcome to the forum! I hope you have a good time with Defold. We’re always looking for first impressions so I’d like to ask you to share your experience over the first few days of using Defold. Thanks!

3 Likes

Hey,

I’m loving it so far! Everything makes sense, everything is well-structured - I could go on and on, but I’m sure that’s not what everyone wants, lol. Looks like I’ll be staying here for a while.

7 Likes