Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - tinyBigGAMES

Pages: [1]
1
General / Re: Pascal Bindings - c struct return issues
« on: July 05, 2014, 07:01:41 pm »
Ahhh.... sweet. Thanks bro.  8)

2
General / Re: Pascal Bindings - c struct return issues
« on: July 05, 2014, 06:47:28 pm »
Hi,

Yes, I have asked in the Pascal related forum. Just covering all bases. I made a build of csfml already for this project. I was just checking to make sure there was no other way. All I was suggesting was that if you add a pointer to the end of the param ref then for those languages that have issues such as Delphi it should then be able to work:

sfContextSettings sfWindow_getSettings(const sfWindow* window);delphi

vs.

sfContextSettings sfWindow_getSettings(const sfWindow* window, sfContextSettings *settings_);

The 2nd should work and not break compatibility. Is all I am saying.

I am just trying to get this to work in Delphi. There are no binding that I know of, so trying to make some and these are the issues I am running into.


3
General / Pascal Bindings - c struct return issues
« on: July 05, 2014, 05:49:10 pm »
I'm currently working on bindings for Pascal. I have it workings somewhat. The one remaining issue (hopfully) is with the way Delphi handles struct function results. I noticed routines that directly returned a c struct would not work on the Delphi side. After struggling with this for a good day, I came across this article:

http://rvelthuis.de/articles/articles-convert.html (go down to the return type section)

That works, but at least in the latest delphi versions (I'm using XE6) it will not let me typecast the Int64 type... to any structure other than one that just so happens to be the same size as an Int64. So using the method described, I am able to get results from sfVectorXXX routines for example. But any other structure when I typecast I get an invalid type cast error.

Does anyone have an idea of to solve this? The only thing that I know to do is the change the function signatures to not return a struct type, but be able to pass a pointer to the struct and that get updated. This will allow great compatibility with other languages.

Pages: [1]