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

Author Topic: SWIG and SFML?  (Read 5867 times)

0 Members and 1 Guest are viewing this topic.

HanClinto

  • Newbie
  • *
  • Posts: 1
    • View Profile
SWIG and SFML?
« on: November 20, 2007, 05:01:24 pm »
Hey all!

I must say, I really like what I see with SFML. Great work, thanks for providing this to the community!!!

I'm currently helping migrate a game (written in C#) away from SpriteCraft and into SDL.Net, but we found SFML today and are interested in seeing how well this route will work. I don't have much experience writing .Net wrappers for things, but in poking around, it seems as though SWIG is a pretty good way to wrap a C++ program and make it accessible to a wide array of languages (Java/Python/C#/Lua/etc).

The trick to SWIG looks like it's creating a good interface file. I'm treading onto shaky new ground for myself here, so I thought I'd post and see if anyone else is familiar with SWIG, or perhaps has maybe even started on an interface file for SFML? It seems as though investing in such a file would open up the way for having autogenerated SFML wrappers for a half-a-dozen languages that can keep themselves up to date with the latest SFML API. At least that's what's advertised -- maybe someone more familiar with SWIG could tell me if that's an exaggerated pipe-dream. :)

Anyone have thoughts on all of this?

Respectfully,
clint

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SWIG and SFML?
« Reply #1 on: November 21, 2007, 02:30:47 am »
Someone wrote SWIG files for SFML a few months ago, but nothing has been really completed since.

SWIG looks like a very easy way of creating bindings for a lot of languages, but I don't think it's the best solution. It's too generic, and as a consequence it looses all the specific features of each language. Just take a look at the Ruby binding, it's not just a translation of the C++ classes, it's more an adaptation to fit the language as good as possible. I don't think you can achieve this with SWIG.
Laurent Gomila - SFML developer