FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

SFML

 
Post new topic   Reply to topic     Forum Index -> Derelict
View previous topic :: View next topic  
Author Message
bioinfornatics



Joined: 22 Jun 2010
Posts: 90

PostPosted: Sun Oct 03, 2010 7:36 pm    Post subject: SFML Reply with quote

hello which project i need use for sfml ?
- derelict
- DSFML (in sfml trunk)
Back to top
View user's profile Send private message
mutable



Joined: 22 Jun 2010
Posts: 87

PostPosted: Mon Oct 04, 2010 2:36 am    Post subject: Reply with quote

Both can you use for SFML, but Derelicts SFML is functional, DSFML is like SFML in C/C++
Back to top
View user's profile Send private message
mutable



Joined: 22 Jun 2010
Posts: 87

PostPosted: Wed Dec 28, 2011 9:04 am    Post subject: Reply with quote

Now that it is possible to interface to C++, there are any plans to make the SFML binding "correct" which means that it can use as SFML in C++ with Classes and Objects?
I tried in the past to use DSFML, but i can't so far. That the reason why i started programming Dgame.
Back to top
View user's profile Send private message
aldacron



Joined: 05 May 2004
Posts: 1322
Location: Seoul, South Korea

PostPosted: Thu Dec 29, 2011 10:32 pm    Post subject: Reply with quote

No, I have no plans to bind to the C++ version. The support for C++ in D makes no difference in Derelict, because there is no static linking. Because Derelict loads shared libraries dynamically, there are a couple of major issues.

The first problem is name mangling. Every C++ compiler mangles function names differently. So in order for a shared libraries from multiple compilers to be supported, the loader would have to take into account the name mangling scheme of each compiler. That alone is something I don't even want to think about.

The second problem is how to load the classes. Even in C++, when dynamically loading a shared library (at least DLLs on Windows, not sure on posix systems) it is necessary to provide a method in the DLL to create an instance of a specific class. As far as I know, there is no other way to do it.

Both of these problems make it very difficult, if not impossible, to create Derelict-style bindings to C++ libraries. If the libraries provide functions with C linkage, and a way to create instances of a class via a method call, then it's possible. And that's essentially what CSFML does.

If you want to bind with the C++ version of SFML using D's C++ compatibility, you'll need to create a direct binding and link with the import library on Windows or the shared object file on Linux.
_________________
The One With D | The One With Aldacron | D Bits
Back to top
View user's profile Send private message Send e-mail
doob



Joined: 06 Jan 2007
Posts: 367

PostPosted: Sat Dec 31, 2011 9:19 am    Post subject: Reply with quote

mutable wrote:
Now that it is possible to interface to C++, there are any plans to make the SFML binding "correct" which means that it can use as SFML in C++ with Classes and Objects?
I tried in the past to use DSFML, but i can't so far. That the reason why i started programming Dgame.


If you create bindings to a C++ library you still need a C/C++ function that create the class instances.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Derelict All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group