Results 1 to 8 of 8

Thread: irrklang headers for pascal

  1. #1

    irrklang headers for pascal

    Today i was programming in c++ and a parter told me to use irrKlang audio lib http://www.ambiera.com/irrklang

    i liked a lot¬?, easy to use and very powerfull

    so i like to convert the headers to my prefered language

    fist i need some help how to c++ -> ObjectPascal types,
    what i typed is correct?

    and what i do with namespaces in pascal?
    Code:
    namespace irr
    {
    //! 8 bit unsigned variable.
    typedef unsigned char		u8; //byte;
    
    //! 8 bit signed variable.
    typedef signed char		s8; //shortint;
    
    //! 8 bit character variable.
    typedef char			c8; // char;
    
    //! 16 bit unsigned variable.
    typedef unsigned short		u16; //word;
    
    //! 16 bit signed variable.
    typedef signed short		s16; //smallint;
    
    //! 32 bit unsigned variable.
    typedef unsigned int		u32; //cardinal;
    
    //! 32 bit signed variable.
    typedef signed int		s32; //integer;
    
    //! 32 bit floating point variable.
    typedef float				f32; //single;
    
    //! 64 bit floating point variable.
    typedef double				f64; //double;
    } // end namespace
    From brazil (:

    Pascal pownz!

  2. #2

    irrklang headers for pascal

    I have noticed that the headers are different (c++ headers), i don't know from where to start... dead before born?
    From brazil (:

    Pascal pownz!

  3. #3

    irrklang headers for pascal

    According to Delphi 6 Developer's Guide:
    Byte -> unsigned short
    Shortint -> unsigned char
    Char -> char
    Word -> unsigned short
    Smallint -> short
    Cardinal -> unsigned long
    Integer -> int
    Single -> float
    Double -> double

    Hope that helps :!:

  4. #4

    irrklang headers for pascal

    You can kind of emulate namespaces in pascal by naming the unit where the definitions are residing the equivalent name as used in the c++ namespace
    Peregrinus, expectavi pedes meos in cymbalis
    Nullus norvegicorum sole urinat

  5. #5

    irrklang headers for pascal

    If some of functions returns or require C++ classes for parameters then you will have to write wrapper library and headers for that wrapper. Look at IrrPascal wrapper... it is far from finish, but it can help you start.

  6. #6

    irrklang headers for pascal

    Quote Originally Posted by Srki_82
    If some of functions returns or require C++ classes for parameters then you will have to write wrapper library and headers for that wrapper. Look at IrrPascal wrapper... it is far from finish, but it can help you start.
    The library have a 1 main device class that have all the other classes, functions and procedures,
    and yes sometimes function returns classes

    I downloaded irrPascal, but you an you explain more wrapper lib?
    From brazil (:

    Pascal pownz!

  7. #7

    irrklang headers for pascal

    This article explains all about using C++ objects in Pascal/Delphi
    http://rvelthuis.de/articles/articles-cppobjs.html

  8. #8

    irrklang headers for pascal

    Quote Originally Posted by Srki_82
    This article explains all about using C++ objects in Pascal/Delphi
    http://rvelthuis.de/articles/articles-cppobjs.html
    Very usefull article, favorited,

    now i can start the header translation
    From brazil (:

    Pascal pownz!

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
  •