Official Pascal-Header (SDK 1.53), last update 26.05.2006

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Postby Sascha Willems » Mon Jan 09, 2006 1:07 pm

I hope these are the correct ones : NewtonImport_132.zip. I usually don't keep older headers but always update the one in my basecode directory, so I searched through old projects and found this one.
User avatar
Sascha Willems
Moderator
Moderator
 
Posts: 346
Joined: Fri Aug 27, 2004 10:18 am
Location: Germany

Postby rick_dodd » Mon Jan 09, 2006 5:11 pm

Thanks for taking the time to do that. I'm getting an access violation when I use what you posted. That makes me think I have a header/DLL mismatch. The date on my dll is 3/16/05.
rick_dodd
 
Posts: 4
Joined: Mon Jul 18, 2005 2:50 pm

Postby Sascha Willems » Mon Jan 09, 2006 5:24 pm

Please redownload it. I found a more "recent" one with update-notes for 1.31, so that one should be correct for 1.32. The one I first posted was for 1.3 I guess then.
User avatar
Sascha Willems
Moderator
Moderator
 
Posts: 346
Joined: Fri Aug 27, 2004 10:18 am
Location: Germany

Postby rick_dodd » Mon Jan 09, 2006 6:19 pm

Sascha,

That must of been a "in progress" copy of the header. I noticed the type definition for PFloat is commented out and it looks like you were using PFloatN.

Thanks,
Rick
rick_dodd
 
Posts: 4
Joined: Mon Jul 18, 2005 2:50 pm

Postby Sascha Willems » Mon Jan 09, 2006 6:27 pm

Yes, but it's the only header from the 1.32 timeframe I have left on my HD, so have you tried it out?
User avatar
Sascha Willems
Moderator
Moderator
 
Posts: 346
Joined: Fri Aug 27, 2004 10:18 am
Location: Germany

Postby rick_dodd » Mon Jan 09, 2006 6:45 pm

I replace PFloatN with PFloat to get my stuff to compile and it worked :) (at lease with the API calls I'm making).

Thanks again.
rick_dodd
 
Posts: 4
Joined: Mon Jul 18, 2005 2:50 pm

Postby Sury » Tue Jan 10, 2006 5:03 pm

I wrote a tool a while back, which attempts to translate newton.h to Delphi.It translates the functions prototypes only (no callbacks and structs), but that does most of the work.
I'm positing it here, in case someone want's to extend it.(C++ Builder)

http://www.geocities.com/delphinewton/header_parser.zip
User avatar
Sury
 
Posts: 193
Joined: Sat Aug 14, 2004 5:32 am
Location: Bulgaria

Postby cht666cht » Tue Jan 17, 2006 6:30 am

Hi, I've tried the Newton headers on Delphi and I had no problems. I've started to use freepascal + lazarus, and I try to execute this:

Code: Select all
program prueba;

{$mode objfpc}{$H+}

uses
  Classes,
  NewtonImport
  { add your units here };

begin

NewtonCreate(nil, nil);

end.


The debugger shows the message: "Project raised exception class 'External: SIGSEGV'", and then another message with some reference to the 'NewtonDestroyAllBodies' procedure.
Is this because some compiler option necesary to link with Newton.dll ? I've no experience with freepascal...
Thanks.
cht666cht
 
Posts: 2
Joined: Tue Jan 17, 2006 6:04 am

Postby Sascha Willems » Tue Jan 17, 2006 6:56 am

Try setting the stacksize in FPC (either via a compiler directive, or via the settings dialog for memory) to something over 1 MByte. The default value under FPC is rather small and unlike Delphi it won't automatically make the stack bigger when requested, so the low stack value will make problems.
User avatar
Sascha Willems
Moderator
Moderator
 
Posts: 346
Joined: Fri Aug 27, 2004 10:18 am
Location: Germany

Postby cht666cht » Tue Jan 17, 2006 8:25 am

Thanks, now it works!
For anyone using Lazarus, I've not found any option in the IDE to set the stack size, so go to "Project -> Compiler Options... -> Other" and write -Cs1048576 in Custom options... I think it sets the stack size to 1 MB
cht666cht
 
Posts: 2
Joined: Tue Jan 17, 2006 6:04 am

Postby aidave2 » Thu Jan 19, 2006 6:12 am

I get an error if I try to run with this function:

NewtonCollisionCollide

"The procedure entry point NewtonCollisionCollide could not be located in the dynamic link library Newton.dll"
User avatar
aidave2
 
Posts: 56
Joined: Sun Jan 08, 2006 7:09 pm

Postby Sascha Willems » Thu Jan 19, 2006 7:00 am

Very suspicious 8) Just tried it and had no problems using the current header and current DLL. I also fired up DependencyWalker and that function is definately in the DLL. Maybe you're using an older DLL? If I'm not mistaken, the function had a different name in older versions of NGD.
User avatar
Sascha Willems
Moderator
Moderator
 
Posts: 346
Joined: Fri Aug 27, 2004 10:18 am
Location: Germany

Postby JernejL » Thu Jan 19, 2006 12:08 pm

*cough*

Did anyone have troubles with my independant newton import header?

did anyone even use it?
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1578
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Postby aidave2 » Thu Jan 19, 2006 5:28 pm

Sascha Willems wrote:Very suspicious 8) Just tried it and had no problems using the current header and current DLL. I also fired up DependencyWalker and that function is definately in the DLL. Maybe you're using an older DLL? If I'm not mistaken, the function had a different name in older versions of NGD.


doh!!!!!!!!!!!!!!!!!
thanks Sascha
you are right, my newton.dll was out of date.

i owe you beer or something for all your help hehe

:lol:
User avatar
aidave2
 
Posts: 56
Joined: Sun Jan 08, 2006 7:09 pm

OOPs i did it again

Postby aidave2 » Wed Jan 25, 2006 5:02 pm

I have a quesiton (sc) about callbacks with Pascal.

Notice how all the callbacks have to be independent procedures?

Is there a way to pass a procedure of a class to the callbacks?

I want full OO!! :cry:
User avatar
aidave2
 
Posts: 56
Joined: Sun Jan 08, 2006 7:09 pm

PreviousNext

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 15 guests