Page 3 of 3 FirstFirst 123
Results 31 to 43 of 43

Thread: c++/cli for cross platform

  1. #31
    obfuscated SDK hacker Lightwolf's Avatar
    Join Date
    Feb 2003
    Location
    Stuttgart, Germany
    Posts
    13,661
    Quote Originally Posted by GregMalick View Post
    If there's a single LW C++ plugin example - that would be awesome.
    For a basic plugin?

    That depends on how far you want to go really.

    I.e., this is a simple generic plugin using lwpp:
    Code:
    #include <lwpp/generic_handler.h>
    
    class HelloWorld : public lwpp::LayoutGenericHandler
    {
    public:
      int Activate()
      {
        lwpp::LWMessage::Info("Hello World!");
      }
    };
    
    lwpp::LayoutGenericAdaptor<HelloWorld> hwInstance("HelloWorld");
    If you just want to turn a vanilla .c plugin source to a .cpp (without actually making use of C++), the main thing to do is to define the callbacks properly to use LWInstance * (which is a void *) and then cast it to whatever your data is. The C style callback definitions using a pointer to the data struct isn't C++ compatible (but fine in C).

    Cheers,
    Mike

  2. #32
    What's this????

    Code:
    #include <lwpp/generic_handler.h>
    Is that your wrapper?

    Somewhere, over the rainbow....

  3. #33
    obfuscated SDK hacker Lightwolf's Avatar
    Join Date
    Feb 2003
    Location
    Stuttgart, Germany
    Posts
    13,661
    Quote Originally Posted by GregMalick View Post
    What's this????

    Code:
    #include <lwpp/generic_handler.h>
    Is that your wrapper?
    Yes, lwpp (LightWrap++).

    Another example is attached (basically the source code of my material Blender) - actually a .cpp file, but I renamed it for the upload.

    Let me see if I can quickly take a LWSDK sample and turn that into something that is at least C++ compatible (not today though).

    Cheers,
    Mike
    Attached Files Attached Files

  4. #34
    Aloha Mike,

    Thanks. Can I get access to look at the headers?

    #include <lwpp/node_handler.h>
    #include <lwpp/vparm.h>


    Somewhere, over the rainbow....

  5. #35
    obfuscated SDK hacker Lightwolf's Avatar
    Join Date
    Feb 2003
    Location
    Stuttgart, Germany
    Posts
    13,661
    Quote Originally Posted by GregMalick View Post
    Aloha Mike,

    Thanks. Can I get access to look at the headers?

    #include <lwpp/node_handler.h>
    #include <lwpp/vparm.h>

    Yes, (as mentioned before ): Register at our forums (http://forums.db-w.com) and PM me if I'm not quick enough to bump your access status.

    The only reason for it not being public is because it isn't finished. But it will be BSD licensed once released.

    Cheers,
    Mike

  6. #36
    Quote Originally Posted by Lightwolf View Post
    Yes, (as mentioned before ): Register at our forums (http://forums.db-w.com) and PM me if I'm not quick enough to bump your access status.

    The only reason for it not being public is because it isn't finished. But it will be BSD licensed once released.

    Cheers,
    Mike
    Done.

    Somewhere, over the rainbow....

  7. #37
    obfuscated SDK hacker Lightwolf's Avatar
    Join Date
    Feb 2003
    Location
    Stuttgart, Germany
    Posts
    13,661
    Quote Originally Posted by GregMalick View Post
    Done.
    Now activate your account (you should have gotten an e-mail) and you have access.

    Cheers,
    Mike

  8. #38
    Done. I've downloaded the rar file. Time to uncompress, print, and do some light reading on the bus-ride home.

    Somewhere, over the rainbow....

  9. #39
    obfuscated SDK hacker Lightwolf's Avatar
    Join Date
    Feb 2003
    Location
    Stuttgart, Germany
    Posts
    13,661
    Quote Originally Posted by GregMalick View Post
    Done. I've downloaded the rar file. Time to uncompress, print, and do some light reading on the bus-ride home.
    Do that.
    I have worked a bit on the general docs in the past few weeks (as well as extending lwpp a bit). There'll be an update once I can catch a breath....

    Also, make sure to read the messages on the forum. They give you an overview on the current state and a couple of extra pointers as well.

    Cheers,
    Mike

  10. #40
    Are you still interested in C++/CLI ? I followed the thread and you seem to have droped the Idea of CLI and stick with pure c++.
    One year ago i started to write a CLI wrapper for the Lightwave SDK.
    I ended with some testplugins implemented in C# and called by Lightwave from native C, but I have stopped working on it because of lack of time.
    If you are interested I could send you some samples.
    But you have to know that it isnt multiplatform at all !! Its restricted to Windows because mono lacks c++/CLI completely (just invoke .. ) and the way from native C into CLR is quite Tricky so its more or less impossible to port it to mono.

    greetings

    Dulo

  11. #41
    Wudai Ninja Waver aurora's Avatar
    Join Date
    Feb 2003
    Location
    Colorado
    Posts
    1,972
    Thanks, but yeah I dropped that approach pretty dang quick. I ended up using wxWidgets for the gui API and wrote my own cross platform wrappers for multi-processing/threading. I'm still pretty much .net free in everything I do. For LW plugins I normally just do brute force c++ although I have used Mikes lwpp and love it!
    Tim - aurora - Dunn
    WorkStation: AMD64 2x2.8 Ghz / 8gb RAM / Win7-64bit / NVidia GTX 560 Ti

    Laptop: Intel i7 8x2Ghz / 16 Gb Ram / WIn7-64bit / GeForce 540M (8.17.12.6780)

  12. #42
    obfuscated SDK hacker Lightwolf's Avatar
    Join Date
    Feb 2003
    Location
    Stuttgart, Germany
    Posts
    13,661
    Quote Originally Posted by aurora View Post
    For LW plugins I normally just do brute force c++ although I have used Mikes lwpp and love it!
    Hey, thanks.
    If there's anything you added I'd love to assimilate it

    Cheers,
    Mike

  13. #43
    Wudai Ninja Waver aurora's Avatar
    Join Date
    Feb 2003
    Location
    Colorado
    Posts
    1,972
    I have a few things I would have loved to have had time to wrap and add but alas, school has been such a B***** this year. Then there's next year
    Tim - aurora - Dunn
    WorkStation: AMD64 2x2.8 Ghz / 8gb RAM / Win7-64bit / NVidia GTX 560 Ti

    Laptop: Intel i7 8x2Ghz / 16 Gb Ram / WIn7-64bit / GeForce 540M (8.17.12.6780)

Page 3 of 3 FirstFirst 123

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •