Jump to content

Delphi/Pascal/Purebasic Header generator


Wchris
 Share

Recommended Posts

index.php?app=downloads&module=display&section=screenshot&id=83

File Name: Delphi/Pascal/Purebasic Header generator

File Submitter: Wchris

File Submitted: 21 Jan 2010

File Updated: 25 Sep 2010

File Category: Tools and Utilities

 

This tool generates object pascal or purebasic headers from original C++ engine.h header.

 

I just updated and enhanced it, the original version was written by Lupin.

 

Source code included

 

Last update 25 September 2010

 

Beta support for purebasic in progress, please follow this thread for more information http://leadwerks.com/werkspace/index.php?/topic/2724-purebasic-import-1st-try/page__pid__25457__st__20#entry25457

 

Click here to download this file

Windows 7 home - 32 bits

Intel Quad Q6600 - nVidia GTX 460 1GB - 2 GB RAM

Link to comment
Share on other sites

  • 7 months later...

Replace the content of 'Templates\PascalTypes.txt' with this:

BP=Pointer
byte=Pointer
float=Single
flt=Single
int=Integer
long=Integer
str=PAnsiChar
const_str=AnsiString
short int=Smallint
unsigned char=Byte

 

That should make it compilable on Delphi.

Link to comment
Share on other sites

The Delphi header conversion does not define const_str. I do not know how to define it.

additionnaly to what Ywa suggested, i would also recpmmend to allways use Ansistring datatype instead of string (http://www.codexterity.com/delphistrings.htm)

 

There is also a project option parameter called "huge stings" i would recommend to check.

 

Leadwerks is not compatible with delphi short strings (like string[25]) or unicode strings (delphi 2009 and 2010 defaults to unicode), only long strings like ansistring (or PansiChar pointers) are compatible.

 

(Many Thanks to Lumooja who added const_str to the C++ headers, because Ansistring is only compatible in read only mode.) It's really great to be able to use AnsiString instead of PansiChar.

 

and Welcome

:blink:

Windows 7 home - 32 bits

Intel Quad Q6600 - nVidia GTX 460 1GB - 2 GB RAM

Link to comment
Share on other sites

additionnaly to what Ywa suggested, i would also recpmmend to allways use Ansistring datatype instead of string (http://www.codexterity.com/delphistrings.htm)

 

There is also a project option parameter called "huge stings" i would recommend to check.

 

Leadwerks is not compatible with delphi short strings (like string[25]) or unicode strings (delphi 2009 and 2010 defaults to unicode), only long strings like ansistring (or PansiChar pointers) are compatible.

 

(Many Thanks to Lumooja who added const_str to the C++ headers, because Ansistring is only compatible in read only mode.) It's really great to be able to use AnsiString instead of PansiChar.

 

and Welcome

:blink:

 

 

Thanks for the new header generator. I no longer get the const_str error. I am now getter an access error to the engine.dll. I am still trying to figure it out. I must be doing something wrong. If I comment the following lines out of the leadwerks.pas file I at least get a window to open up:

 

LEPositionEntity (entity, position, global);

Result := LECreateSpotLight (range, parent);

LERotateEntity (entity, angle, global);

Result := LELoadMaterial (name);

Result := LECreateCube (parent);

LEPaintEntity (entity, material, recursive);

LEScaleEntity (entity, scale);

Result := LECreateDirectionalLight (parent);

LETurnEntity (entity, angle, global);

LEUpdateFramework;

Link to comment
Share on other sites

Thanks for the new header generator. I no longer get the const_str error. I am now getter an access error to the engine.dll. I am still trying to figure it out. I must be doing something wrong. If I comment the following lines out of the leadwerks.pas file I at least get a window to open up:

 

LEPositionEntity (entity, position, global);

Result := LECreateSpotLight (range, parent);

LERotateEntity (entity, angle, global);

Result := LELoadMaterial (name);

Result := LECreateCube (parent);

LEPaintEntity (entity, material, recursive);

LEScaleEntity (entity, scale);

Result := LECreateDirectionalLight (parent);

LETurnEntity (entity, angle, global);

LEUpdateFramework;

Link to comment
Share on other sites

Hi Kratest,

 

your provide no source code, so it's difficult for me to understand what's wrong. :blink:

 

what version of delphi do you use ?

 

have you tryed this example http://leadwerks.com/werkspace/index.php?/files/file/87-simple-frawewerk-lua-sample/

 

if not, can you try it (with the complete header) and tell me if it works with the header you generated ?

Windows 7 home - 32 bits

Intel Quad Q6600 - nVidia GTX 460 1GB - 2 GB RAM

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...