Page 1 of 1

IrrlichtPas: Pascal bindings for Irrlicht

Posted: Mon Oct 26, 2009 1:03 am
by Stoney
This is yet another attempt to enable using Irrlicht with FreePascal or Delphi.

I know, there are already two existing pascal/Delphi bindings, but both of them have their disadvantages:
- Irr4Delphi: Uses Irrlicht 1.5; Not open-source, not supporting Linux or Mac OS X
- IrrPascal: Uses Irrlicht 1.3; developement halted; not supporting Linux or Mac OS X

I felt the need to create IrrlichtPas primarily for two reasons:
- My main development system is a MacBook Pro with Mac OS X, so I want to use Irrlicht on Mac OS X and the existing Irrlicht bindings do not cover that area
- I had a lot of problems getting SDL to work with Mac OS X Snow Leopard and converting my existing projects. Most of the problems are gone when SDL 1.2.14 was released, but new problems with SDL_gfx came up. That's when I began experimenting with Irrlicht, IrrlichtWrapper and FreePascal.


First of all, I'm actually quite lazy, that's why I didn't write my own Wrapper library, I'm using a slightly modified version of Frank Dodd's excellent IrrlichtWrapper for FreeBasic. I added support for Irrlicht 1.6 and expanded 2D functionality with three procedures (IrrDrawImageElementColor, IrrDraw2DRectangle, IrrSetColorKeyPos). There are still some major issues at the moment like the First-Person-Shooter-Camera not working correctly.


IrrlichtPas has been sucessfully tested on Windows, Linux and Mac OS X.
There are no classes at the moment, just a bunch of functions and procedures.

Here is a screenshot of IrrlichtPas working on Mac OS X Snow Leopard:
Image
Click on the image to enlarge.

Project Homepage: http://sourceforge.net/projects/irrlichtpas/
There is already an early alpha version for Win32 available which also works on Linux and Mac OS X if you compile the Irrlicht and IrrlichtWrapper libraries yourself. I will try to upload Linux and Mac OS X packages in the next few days.

Posted: Fri Oct 30, 2009 11:55 am
by tinhtoitrangtay
it can't unzip file

Posted: Fri Oct 30, 2009 1:11 pm
by Stoney
Works for me on Mac OS X with standard unzip utility and Windows XP and 7 with WinRAR.
Which OS and zip/unzip tool are you using? Have you tried unzipping with WinRAR?
Edit: You could to try to download the file again and unzip with it with WinRAR.

Posted: Thu Nov 12, 2009 9:40 am
by panoramic
I'm very interested by your adaptation to pascal (Delphi).
I downloaded your software and I tried to run the examples with Delphi6.

First of all, in the file IrrlichtWrapper.pas, I had to change in function IrrAddTiledTerrain the line smoothing: integer = 0.0; by:
smoothing: integer = 0; and it compiles.

I have a problem with 04_Example_3DModel: the character appears and the executable crashes.

I'm interested by your work to provide my software (http://www.panoramic-language.com) with true 3D-game capabilities.

Posted: Mon Nov 23, 2009 9:42 am
by Stoney
panoramic wrote: I downloaded your software and I tried to run the examples with Delphi6.

First of all, in the file IrrlichtWrapper.pas, I had to change in function IrrAddTiledTerrain the line smoothing: integer = 0.0; by:
smoothing: integer = 0; and it compiles.

I have a problem with 04_Example_3DModel: the character appears and the executable crashes.
Thank you for testing IrrlichtPas with Delphi 6.
Are the other examples except for 04_Example_3DModel working?
Unfortunately I don't have Delphi 6 myself, I only have Delphi 3 / Delphi 7 Personal Edition and Turbo Delphi 2006 and haven't had time to test IrrlichtPas yet, because I've been using FreePascal for the last couple years.

Posted: Mon Nov 23, 2009 1:22 pm
by IrrDelphi
If it is interesting, later I shall upload pas-headers for direct work with Irrlicht without wrappers

Posted: Mon Nov 23, 2009 3:00 pm
by panoramic
I shall upload pas-headers for direct work with Irrlicht without wrappers
I'm very interested for that !
I intend to upgrade my software (written in Delphi) to a tool able to build 3D games with Irrlicht.

Posted: Mon Nov 23, 2009 5:45 pm
by Stoney
IrrDelphi wrote:If it is interesting, later I shall upload pas-headers for direct work with Irrlicht without wrappers
I am really interested in how you achieved that, are you using a modified version of Irrlicht? Could you please provide some more information on the technical side?

Posted: Mon Nov 23, 2009 7:49 pm
by panoramic
To work with Irrlicht without wrapper and using the pascal language is a dream for me.
How can you reach that?

Posted: Wed Nov 25, 2009 12:36 pm
by IrrDelphi
I have written headers for this purpose and I shall upload them tomorrow. Also translated about 15 examples from original SDK

About tech. I try to explain that in English...

For classes c++ used thiscall call conversion, but delphi not supported them.
I write proc. for emulate this in delphi and write headers for use. That all)
And yes - I used original 1.6 (Earlier 1.5.1) library without modification.

ps. Minimal requires it's 2005 (recomended Turbo or higher) delphi. And I do not know about FPC.. These restrictions are because i used records with methods and overriding class(records) operators. example:

Code: Select all

...
class operator Positive(a: vector3df): vector3df;
class operator Negative(a: vector3df): vector3df;
...
var
 aa: vector3df;
 bb: vector3df;
...
 aa := aa + bb;
and etc..

Posted: Wed Nov 25, 2009 8:47 pm
by Stoney
IrrDelphi wrote:I have written headers for this purpose and I shall upload them tomorrow. Also translated about 15 examples from original SDK
I'm looking forward to it. If it really works as you say, that's really a major step. :)

Operator overloading is supported with FreePascal. Well, trying to get it work with FreePascal will be one of the first thing I will do after you've uploaded you work.

Posted: Thu Nov 26, 2009 4:05 pm
by IrrDelphi
Yes it real :wink: look http://irrlicht.sourceforge.net/phpBB2/ ... 334#211334

ps. about fpc: I have begun portation, but it is not finished yet.
At present examples not compile because of mistakes with operators overloading and many fpc lacks =\