Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat
Step By Step : How to write a C++ plugin and Deploy it to the Desktop (Windows) Player - Page 2 - Gideros Forum

Step By Step : How to write a C++ plugin and Deploy it to the Desktop (Windows) Player

2»

Comments

  • Finally, i got to work with some C functions enableDimming and disableDimming. I've compiled the plugin with QT and works like a charm :) . However, the next step getting work the basic steam library still doesn't work. mmmm, i supossed there is my .pro file that hasn't well configured. I'll try to do more tests this week.

    The official Steam example is running on Visual Studio. So, do you say it couldn't work with mingw? oh no...
  • I am getting "can not find -llua" error after mingw32-make command. Does anyone know how to fix it?
  • @metrocan How did you get on with this guide? Does it need to be updated in any way?
  • Is this article still valid?
  • hgy29hgy29 Maintainer
    It doesn't look valid to me, or at least portable.
    First, MSVC shouldn't be used directly. Since desktop gideros is based on QT, it is better to use 'qmake' and let Qt choose the compiler itself.
    Code itself looks good otherwise.

    The tedious thing with plugins is that each target platform has its own way to do things. It is not an issue if your plugin just does basic computing (math/crypto/codec/...) but if you need to call OS functions then you need specific code for each platform: Java/JNI for Android, ObjC for iOS, etc

    I think it would be good to have some sort of 'Hello World' plugin, something that does nothing useful but which could serve as a template for developing real plugins, instead of taking a full featured plugin and then removing code.

    Likes: simwhi

    +1 -1 (+1 / -0 ) Share on Facebook
  • n1cken1cke Maintainer
    I will try to write new tutorial about plugin developing using Sol binding framework. Currently it works for desktops, maybe we can extend it to mobile platforms because Qt allows to build Android and iOS libraries.

    With Sol you can write plugins like this:

    [C++ code]
    double distance(double x1, double y1, double x2, double y2) {
            return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
    }
     
    int PLUGIN_NAME (lua_State* L) {
        sol::state_view lua(L);
        lua["distance"] = distance;
        return 0;
    }
    [Lua code]
    require "your_plugin_name"
    local d = distance(10, 40, 70, 80)
    As you can see this is super easy: write in C++ as usual and add one line to "plugin binder" (lua["distance"] = distance; in this case).
    +1 -1 (+4 / -0 ) Share on Facebook
  • Well something would be great since I seem to have to create a plugin that supports what I need myself :)
  • Well, thanks for your tips :d I am a newbie
    My Lawn Care Blog: http://www.lawnmowertips.com
  • @n1cke I would love to know how to build plugins for Android and iOS. Anything that would make writing plugins easy would get my vote.

    Likes: pie

    +1 -1 (+1 / -0 ) Share on Facebook
  • n1cken1cke Maintainer
    @simwhi: I would like to know this too :) For some reason Sol gives me errors when I try to build simple lib for Android.
Sign In or Register to comment.