Quote Originally Posted by grudzio
All right, I've managed to make it run without crush.
the gluUnProject declaration should be changed from
[pascal]
gluUnProject: function(winx, winy, winz: GLdouble; const modelMatrix, projMatrix: T16dArray; viewport: TViewPortArray; objx, objy, objz: PGLdouble): Integer; {$IFDEF WIN32}stdcall;{$ELSE}cdecl;{$ENDIF}
[/pascal]
to
[pascal]
gluUnProject: function(winx, winy, winz: GLdouble; var modelMatrix, projMatrix: T16dArray; var viewport: TViewPortArray; objx, objy, objz : GLdouble ): Integer; {$IFDEF WIN32}stdcall;{$ELSE}cdecl;{$ENDIF}
[/pascal]
Thanks everyone!! I have changed the declaration to this

Code:
gluUnProject: function(winx, winy, winz: GLdouble; var modelMatrix, projMatrix: T16dArray; var viewport: TViewPortArray; objx, objy, objz: PGLdouble): Integer; {$IFDEF WIN32}stdcall;{$ELSE}cdecl;{$ENDIF}
and it works beautifully in both Delphi 5 and Lazarus!!

Thanks again!

cheers,
Paul.