Monkey GLFW libs

Monkey Archive Forums/Monkey Discussion/Monkey GLFW libs

Armitage1982(Posted 2012) [#1]
Sorry for not following the Monkey dev. too much.

But I would like to ask if there's finally a smooth and easy solution to use external libraries inside Monkey and if this feature is still planned ?

Thanks :)


Armitage1982(Posted 2012) [#2]
I saw that Adam was trying to port wxWidgets to monkey.

I had a quick look at the sources but if I understand correctly you still need to "Glue" C++ Class, function pointers, write Strings and other conversion system...

It's looking very complicated.

Isn't it important to think about this aspect of Monkey?


ziggy(Posted 2012) [#3]
Using C# libs is very easy and I suspect Java integration can be very easy too. In general, I think the problem on the C++ targets is Garbage Collection. This can give some problems, but on C# or Java, libraries interaction should be very trivial.


AdamRedwoods(Posted 2012) [#4]
It is difficult, and yes, it's because of cpp garbage collection.

Cpp classes need special treatment for GC, which means glue code. I've found multi-inheritance with "Object" and the other class seems to work.
And another problem is that Monkey does not allow New() ctors to be externed. This causes more glue code.

BUT-- I find it slightly easier than BlitzMax.


Armitage1982(Posted 2012) [#5]
@Adam
So we could say there is no easy way to use external libraries in Monkey.
Do you think you could document as much as possible your porting work of WxWidgets? That way I could eventually learn from you how to do it correctly.
That would be really nice!

@Ziggy
This may be very interesting for Java.
I mostly think about LibGDX, a very complete and performant gaming Framework. Plus Java have solid GUI like Swing, which is a good thing for application software programming!
Furthermore it's including a recent (2.2.1) JNI Wrapper of Box2D. I wonder if it would be easier to use Box2d through this Java Wrapper?
You already told me a bit about the use of C# libs, and that true it was easier than C++.

Again I understand where is the advantage of using a C++ library in Monkey, mostly because the syntax is easier to learn but also for speed and optimization reasons, but I don't get it when it comes to very similar language like Java or C# ?


Samah(Posted 2012) [#6]
Armitage I actually started work on a libgdx target ages ago in the hope of getting better performance on Android. I got the graphics working, but it ended up being about the same speed as Mark's implementation.


ziggy(Posted 2012) [#7]
but I don't get it when it comes to very similar language like Java or C#
Modern Java and C# can be as fast as C++ in some areas and also, if you want something to work on a XBox, C# is currently the only way on Monkey, also if you want something to work on Android AFAIK Java is your best option (or C++ in current Android but with a Java importer).
Additionally, there are tones of libraries written in C# and tones of libraries written in Java that can be very interesting.
Additionally, I think writing the glue code in C# or in Java and importing the "glued" code directly in Monkey somehow looked easier to me than writing the glude code directly on Monkey.


Armitage1982(Posted 2012) [#8]
@Samah
Too bad you didn't continue on this because what's interesting with LibGDX is the Framework in itself! Why reinventing the wheel if Monkey is primarily made to use existing languages and SDK?

@Ziggy
I have no doubts that C# and Java is fast enough for my needs. Generally I'm only speaking of speed because I probably write bad code ;)

In fact I'm not interested to work on any gaming console yet and I'm not quite ready for iOS or Android (but if it's available of course, it's all the better).
The 3 main platforms and why not HTML5 would be just fine.

You right!
There's a tones of libraries written in C# and even more on Java! That's exactly why I'm looking into an easy transition between BlitzMax and those languages.
I could go directly into Java or C# but then Monkey appear in the middle and would make a perfect companion.

Except that I don't get anything under the hood of this brilliant tool :(
I think it's partly because there's only one tiny page of documentation on this.