Recent

Author Topic: DirectX - Delphi to Lazarus.  (Read 6788 times)

marmin

  • Jr. Member
  • **
  • Posts: 86
    • http://www.naton.org
DirectX - Delphi to Lazarus.
« on: March 04, 2005, 06:06:07 am »
OK, I've spent the whole night porting to L. an Alpha version of a 3D - game (Direct3D) for Win32  I am developing in Borland Delphi 6.
Why?

1) I think Pascal is a very good medium for DirectX (and OGL b.t.w.):D
2) I was curious if I could make the transition from Delphi to Lazarus in one night.
3) I wanted to check Free Pascal compiler Performance!
4) It's cool L. to be cross-platform, free & open-source.

I'm happy to announce that I succeeded in doing so!

There were a lot of nasty thingz to get rid of, this compiler 'behaves' different than the Delphi compiler, that's for sure.

My first impression (And I'm of course goin' to benchmark all kinds of stuff like hell) is that Lazarus is running stabler and -faster- than my application in D, but this impression can be the result of fatigue. (it's 5:53 in the morning).

regards,
M.
Marmin^.Style
Location: Pointer Land!

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2519
DirectX - Delphi to Lazarus.
« Reply #1 on: March 07, 2005, 01:54:37 pm »
If you app depends on DirectX, don't count on cross-platform.
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

marmin

  • Jr. Member
  • **
  • Posts: 86
    • http://www.naton.org
DirectX - Delphi to Lazarus.
« Reply #2 on: March 08, 2005, 12:42:53 am »
I know that of course.. but I did want to test the speed of the Free Pascal compiler.
And for now it seems, actually, that this game compiled by the FP compiler is actually faster than the game compiled in D. 6

The game depends -heavily- on floating point calculations.
The calls to the Direct X API, and the drawing on the screen, shouldn't make much difference in both compilers (as they're done by the video card).

I think I'm gonna write a small test appl. to benchmark things.
Marmin^.Style
Location: Pointer Land!

Lightning

  • Sr. Member
  • ****
  • Posts: 422
DirectX - Delphi to Lazarus.
« Reply #3 on: March 15, 2005, 08:51:06 am »
It has been reported that better at some things and not so good at others, for example floating point calculations really are faster in FPC.
As for the graphics API..., OpenGL and DirectX(3D) should get about the same speed using proper techniques, OpenGL has the advantage of being CrossPlatform so you don't have to completly rewrite your code and it is also a verry clean and easy to learn API, the number of games that use OpenGL has increased lately mostly because of the higher quality drivers and the market wich needs games for platforms like MAC OS X and Linux.
The future must be... Fast and OpenSource so...
Think Open and Lightning Fast!

marmin

  • Jr. Member
  • **
  • Posts: 86
    • http://www.naton.org
DirectX - Delphi to Lazarus.
« Reply #4 on: March 17, 2005, 12:57:17 am »
Yeah, it's fascinating to port my (alpha-stage) game into FreePascal c.q. Lazarus, I did not expect it to be faster! It could be that memory management and FP calculations are more efficient.  

I have this question:

Does FP compiler 'treat' the if..then statement differently than the Delphi compiler?
It seems that there is (there MUST be) a little difference.
Marmin^.Style
Location: Pointer Land!

Lightning

  • Sr. Member
  • ****
  • Posts: 422
DirectX - Delphi to Lazarus.
« Reply #5 on: March 18, 2005, 12:09:52 pm »
Quote from: "marmin"
Yeah, it's fascinating to port my (alpha-stage) game into FreePascal c.q. Lazarus, I did not expect it to be faster! It could be that memory management and FP calculations are more efficient.  

I have this question:

Does FP compiler 'treat' the if..then statement differently than the Delphi compiler?
It seems that there is (there MUST be) a little difference.

Well i know how case works but for if you have to ask on the FPC mailing list or the #fpc channel on irc.freenode.net(org)
The future must be... Fast and OpenSource so...
Think Open and Lightning Fast!

 

TinyPortal © 2005-2018