Using an external library (imgui)

Monkey Forums/Monkey Programming/Using an external library (imgui)

Htbaa(Posted 2014) [#1]
I stumbled across this neat little library today https://github.com/ocornut/imgui and was wondering if it at all is possible to use it with Monkey. I think it depends on the target I think? Since this library is written in C++ I think you're bound to the Desktop and C++ target?


Nobuyuki(Posted 2014) [#2]
you'd need to create a wrapper class and a way to make it work with mojo.
Once you do that you can use it on any platforms it supports -- Android (NDK), ios, desktop, provided the original lib can also work here and you follow the same directions.


amando(Posted 2014) [#3]
Is there any tool that can aid to create C++ wrappers or must be created by hand by experienced C++ developers?
Thx


Sammy(Posted 2014) [#4]
AFAIK Android NDK support has not been implemented on Android, it was cancelled when BRL stopped adding major features.


Nobuyuki(Posted 2014) [#5]
You can link to NDK yourself from java code. Having an NDK-specific target isn't part of an inherent Monkey limitation.
https://thenewcircle.com/s/post/49/using_ndk_to_call_c_code_from_android_apps


Sammy(Posted 2014) [#6]
Sorry that was a badly worded reply. I should have said that Mark was working on a Monkey NDK based target(which I thought you were referring to) which would have generated NDK linkable Android C++ code instead of the current Java code. Using C++ would have been the same as most of the other platforms, a simple Import.

Correct me if I am wrong, but I think the only way to get C++ into Monkey for Android is to create and link a statically linkable library and use the NDK to interface with it and Java. I genuinely would love to be proved wrong here as this prosess it a bit of a PITA.