Danilo

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 145 total)
  • Author
    Posts

  • Danilo
    Participant

    You can add external module directories by setting the environment variable MX2_MODULE_DIRS.

    In Unix shells:

     

    You can add more than one directory. Separate the directories with a semicolon “;”:

     

    I think on Windows OS it was the command SET:

     

    Alternatively you can add the line to your env_linux.txt / env_macos.txt / env_windows.txt in bin/

    in reply to: Requiring discord to join forums #16171

    Danilo
    Participant

    There is also https://rocket.chat for team/community communication.

     

    It is open source: https://github.com/RocketChat and available for Windows/Linux/Mac/Android/iOS/Web

    in reply to: Mod Help #16121

    Danilo
    Participant

    Just my personal opinion: I don’t think a Monkey-X book is of any help with Monkey2.

    The modules are completely different, in my opinion.

    in reply to: Mod Help #16118

    Danilo
    Participant

    The folder should be “/modules/baseinterface” and the filename “baseinterface.monkey2” if you want to #Import “<baseinterface>”.

    in reply to: Fist class function in collection with struct parameter #16078

    Danilo
    Participant

    Wrong C++ code is generated, so you should report it at github as a bug.

    As a workaround you could use Alias EventCb:Void( event:Event Ptr )

    in reply to: What is an interface? (POO) #16060

    Danilo
    Participant

    Small example:

    in reply to: What is an interface? (POO) #16058

    Danilo
    Participant

    https://en.wikipedia.org/wiki/Interface_(object-oriented_programming)

    An Interface contains declarations of methods, the parameters, and the return type.

    Any class that implements the Interface is required to implement **everything**
    from the Interface, exactly like it was declared.
    It is like a contract/agreement and you can trust that the specific methods
    are implemented in the classes.

    in reply to: Load 3d library in monkey 2 #16054

    Danilo
    Participant

    > is it possible to load the library in Monkey 2 without creating .h and C files?

    Monkey2 is a little bit different because it translates to C++.
    When you import something, you need to tell Monkey2 and the C++ compiler about that stuff.
    If you don’t tell Monkey2, it does not know the functions.
    If you don’t tell C++, it does not know the functions and you will get an error.

    So you need at least the Monkey2 ‘Extern’ import section and the C/C++ header with the functions/classes.

    in reply to: Load 3d library in monkey 2 #16048

    Danilo
    Participant

    by the way I did not know how to stop the application

     

    I put a counter 0 to 1001 in the code, otherwise it would Repeat..Forever.
    The window title counts to 1001 and quits.

    in reply to: Load 3d library in monkey 2 #16044

    Danilo
    Participant

    That GetProcAddress() method brings up some casting issues,

    so it is probably easier to import a “Gear3D.lib” (DLL import).

     

    I made a quick test using LoadLibrary and GetProcAddress in a C++ file. File is attached.

    Compile it and put Gear3D.dll and Link.dll in Gear3D.products/Windows/ folder, so Gear3D.exe can find the DLLs.

    Attachments:
    1. Gear3D.zip
    in reply to: Load 3d library in monkey 2 #16041

    Danilo
    Participant
    • Is Gear3D compiled for 32bit or 64bit?
    • Ascii or Unicode?
    • What type are the function parameters?
      • InitG3D( Byte, Byte )
      • InitG3D( Word, Word )
      • InitG3D( Int, Int ) ?
    in reply to: Load 3d library in monkey 2 #16038

    Danilo
    Participant

    Shouldn’t be a problem. 🙂 Please give download links for test lib and latest gear3d.


    Danilo
    Participant

    This init part is for the struct with an array of 2 unsigned and 1 double.

     

    Your struct colors[64] does not use such initialization:

     

    As you can see, ‘ = { values }; ‘ is used for init, and the inner ‘{ values }’ is for array init.

     

    See also: cppreference.com >> C reference >> initialization >> array initialization

    Initialization from brace-enclosed lists

    Nested arrays


    Danilo
    Participant

    When I search the site for “MixingPlan” I get more than one result, and it looks like you mix them up.

    1st, 2nd, 3rd search result are in the same source code:

    More search results containing “MixingPlan” show up.

    Later there is a source code with a new MixingPlan struct:

     

    Next one:

     

    And then, at round about the middle of the page (last search result):

    in reply to: Load 3d library in monkey 2 #16030

    Danilo
    Participant

    First you need to import “<win32>”, that imports the file /modules/win32/win32.monkey2

    LoadLibrary and GetProcAddress are not imported yet, so you need to add it. LoadLibraryA uses ASCII chars, so better use LoadLibraryW for wide chars (Unicode).

    If LoadLibrary() and GetProcAddress() get added to the win32 import, you could remove the ‘Extern’ section.

    Of course untested, but that’s the general way how it would work with dynamic loading of DLL functions at runtime.
    If you have a DLL import file (.lib), you could directly import it. If the DLL uses ASCII strings, a conversion from Unicode to ASCII would be required for the strings.

    If you have a Unicode version of the .dll you would use this.

Viewing 15 posts - 1 through 15 (of 145 total)