Results 1 to 7 of 7

Thread: A few questions about the command line compiler

  1. #1

    A few questions about the command line compiler

    I learned on how one can use the free command line compiler. Now I wanted to know if it is possible to use third party libraries (e.g. a Java game engine). And if so, how to do it.
    Best regards,

  2. #2
    I'm not sure, but I think that it's impossible to use a Java library with Free Pascal or Delphi, as Java uses a Virtual Machine. Anyway you can use third party libraries if you have the interface.

    For example, Allegro.pas is actually the interface to use the Allegro library, which is written in C. Also, the GL/OpenGL units (one for FPC, the other for Delphi) are actually the interfaces to use the OpenGL library, which is (often) written in C too. Actually you can use most libraries written in C without problems. Other languages than C are a bit tricky, but some are just impossible as Java (except you're using a Pascal compiler that generates a Java executable like Oxygene IIRC). C++ is also one of these "non compatible with" language. Well, actually you can use C++ in (Object) Pascal, but it's too much complex.

    So you just need the interface. If you haven't it then you can write it by yourself. Of course you'll need some knowledge about the language to success.
    Last edited by Ñuño Martínez; 09-03-2013 at 06:33 PM.
    No signature provided yet.

  3. #3
    Erm, this was posted in the Oxygene for Java board so I am not referring to FreePascal or Delphi here...
    Best regards,

  4. #4
    Quote Originally Posted by Cybermonkey View Post
    Erm, this was posted in the Oxygene for Java board so I am not referring to FreePascal or Delphi here...
    Ups! My fault. Sorry.
    No signature provided yet.

  5. #5
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Blog Entries
    Wow I guess this thread is a bit old, but here goes anyhow.

    Paul and I have been using libGDX quite successfully for our game on the OUYA. Supports and runs on Android phones and tablets and even the mighty OUYA gaming console. All you really need to do is include your library's jar files and make calls towards their classes.

    Oxygene for Java is kind of like a superset of Object Pascal in that it incorporates a lot of the Java language functions into it, however the language is still very much Object Pascal with a few exceptions. This allows you to use suh libraries without the need to create all these translated wrappers. It does this rather elegantly actually.

    Correct me if I'm wrong anywhere here Paul.
    Jason McMillen
    Pascal Game Development

  6. #6
    Yes it is possible. It is one of the great strengths of Oxygene IMO. We have the entire selection of Java libraries available. Oxygene even translates all get/set methods to properties so that you don't e.g. have to write object.setX(object.getX() + 5) all the time but can just write inc(object.x, 5) which is way more Pascalish.
    Imagine I've written something clever here inspiring you to make something awesome. If that happens give me credits

  7. #7
    But that's all possible with the free command line compiler? Cool, I'll have a closer look soon.
    Best regards,


Posting Permissions

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