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

Author Topic: up-to-date D bindings for the v1.5 C API  (Read 10639 times)

0 Members and 1 Guest are viewing this topic.

Trass3r

  • Jr. Member
  • **
  • Posts: 91
    • View Profile
up-to-date D bindings for the v1.5 C API
« on: December 28, 2009, 04:23:03 pm »
Just to let you know, Derelict now includes bindings to v1.5 of the C API.
http://www.dsource.org/forums/viewtopic.php?t=4932

Remember that this is not a wrapper like DSFML, only the necessary function definitions etc. needed to directly use the C API from D.

hide

  • Newbie
  • *
  • Posts: 3
    • View Profile
up-to-date D bindings for the v1.5 C API
« Reply #1 on: September 03, 2010, 01:25:07 pm »
What's the difference between a wrapper and bindings ?

AndrejM

  • Newbie
  • *
  • Posts: 29
    • View Profile
up-to-date D bindings for the v1.5 C API
« Reply #2 on: September 03, 2010, 04:39:34 pm »
Quote from: "hide"
What's the difference between a wrapper and bindings ?

AFAIK a wrapper will take care of some things for you, e.g. initialization/cleaning, conversion between specific types from C to D and vice-versa. With a binding, you have to do these things yourself. But correct me if I'm wrong, Trass3r :)

Trass3r

  • Jr. Member
  • **
  • Posts: 91
    • View Profile
up-to-date D bindings for the v1.5 C API
« Reply #3 on: September 04, 2010, 02:37:56 pm »
A binding is more or less a port of the header file to D so you can use the API.
A wrapper adds a layer on top of that to make it easier to use it, usually creating an OOP-based access model.

hide

  • Newbie
  • *
  • Posts: 3
    • View Profile
up-to-date D bindings for the v1.5 C API
« Reply #4 on: September 05, 2010, 12:27:54 am »
Can you show a striking example (or more) with SFML ? I have difficulties understanding what's so different about this.

Trass3r

  • Jr. Member
  • **
  • Posts: 91
    • View Profile
up-to-date D bindings for the v1.5 C API
« Reply #5 on: September 12, 2010, 10:29:11 pm »
CSFML needs to "flatten" the API because C doesn't understand OOP. So it creates single functions like Sprite_SetX(Sprite* this, x)
A binding simply makes these C functions accessible from D by making the necessary function definitions.
DSFML "converts" this flat API back to an OO one so that you again have a Sprite class with methods and so on

mrjnewt

  • Newbie
  • *
  • Posts: 3
    • View Profile
up-to-date D bindings for the v1.5 C API
« Reply #6 on: October 06, 2010, 11:07:39 pm »
Are these bindings compatible with 1.6 or will I need to revert to the previous package?

Trass3r

  • Jr. Member
  • **
  • Posts: 91
    • View Profile
up-to-date D bindings for the v1.5 C API
« Reply #7 on: October 08, 2010, 10:32:22 pm »
Derelict still focuses on 1.x until 2.0 is finally released.
1.5 or 1.6 shouldn't make that much of a difference since it is a bugfix release mostly.

 

anything