Giter Site home page Giter Site logo

dsfml's People

Contributors

aubade avatar aurose94 avatar blastrock avatar cschram avatar elfeesho avatar grogancolin avatar jebbs avatar kamirr avatar kelet avatar luhrel avatar luke5542 avatar mattwca avatar nikibobi avatar patrickjm avatar trvb avatar tyoverby avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dsfml's Issues

Add CONTRIBUTING file?

Maybe you should add a CONTRIBUTING.md file so others can see how to contribute to the repo. Probably mention some guidelines for those who want to write tutorials or examples or just want to contrubute.

If such file exists Github will make sure to show a link to that file before creating an issue or pull request. See this blog post for more info.

SFML.Net styled events in DSFML?

I was looking at SFML.Net and I saw the examples and I noticed how they did their events. I was thinking maybe we could do the same thing with DSFML and D. We can use an Array of function pointers and have event handles too! To me we could achieve a lot more with this than with event polling.

So I was wondering if this sounds cool with you guys?
I think I could make this as long as you guys think its a excellent idea otherwise I won't do it. Or we could actually have both event polling and event callbacks? Best of both worlds? eh?

Music class can't load mp3 files

I have been trying to play an audio file with Music class. First when I started I got libsndfile-1.dll missing error. Then I downloaded the dll from the original SFML repo in the extlibs folder, but then I got:

Failed to open sound file "music.mp3" (File contains data in an unknown format.)

I tried with a few other different files, but the result was always the same. Then I tried .wav file format and it worked perfectly fine. So there is an issue with .mp3 file format reading.
I have to test it out with other file formats like .ogg and also try to do it with Sound class.

spine-dsfml - spine binding for DSFML

Hi, I have started working on spine runtime library for D. And I have separated it into two repositories spine-d and spine-dsfml that will use your version of SFML and spine-d. The spine-d will be a pure D(no C bindings) copy of the runtime core. And spine-dsfml will use the core and dsfml to render the 2D animations.

The spine-d is almost done(need to implement parsing json only), but I haven't commited it yet. The spine-dsfml should be small and only use the two and implement the skeleton rendering part. So by the end of this week(or the next one) I will have a working project and you can add a reference to it in the README.md when its working(I will probably notify you then).

Oh and I just got an idea... about #33 (I will post it on the issue)

What version of SFML I am should use?

I am build libcsfml and install it to /usr/local/lib/libcsfml-*, but linker says:

dmd -I/usr/include/dmd/ -I./DSFML/ -L-ldl -L-lcsfml-window -L-lcsfml-system -unittest -g -debug -L-L/usr/local/lib/libsfml-window.so.2.0 -ofmain
libosmpbfd.a ./DSFML/dsfml/*.d math/rtree2d.d math/geometry.d math/graph.d math/earth.d pb_encoding.d osm.d sfml.d main.d
main.o: In function _D5dsfml5audio8Listener12GlobalVolumeFNdfZv': /home/denizzz/gis-stuff/./DSFML/dsfml/audio.d:33: undefined reference tosfListener_setGlobalVolume'
main.o: In function _D5dsfml5audio8Listener12GlobalVolumeFNdZf': /home/denizzz/gis-stuff/./DSFML/dsfml/audio.d:37: undefined reference tosfListener_getGlobalVolume'
main.o: In function _D5dsfml5audio8Listener8PositionMFNdS5dsfml6system14__T7Vector3TfZ7Vector3Zv': /home/denizzz/gis-stuff/./DSFML/dsfml/audio.d:46: undefined reference tosfListener_setPosition'
main.o: In function _D5dsfml5audio8Listener8PositionMFNdZS5dsfml6system14__T7Vector3TfZ7Vector3': /home/denizzz/gis-stuff/./DSFML/dsfml/audio.d:50: undefined reference tosfListener_getPosition'
main.o: In function _D5dsfml5audio8Listener9DirectionMFNdS5dsfml6system14__T7Vector3TfZ7Vector3Zv': /home/denizzz/gis-stuff/./DSFML/dsfml/audio.d:58: undefined reference tosfListener_setDirection'
main.o: In function _D5dsfml5audio8Listener9DirectionMFNdZS5dsfml6system14__T7Vector3TfZ7Vector3': /home/denizzz/gis-stuff/./DSFML/dsfml/audio.d:62: undefined reference tosfListener_getDirection'

etc. And:

$ readelf -s /usr/local/lib/libcsfml-*.so.2.0 | grep sfListener_setGlobalVolume

returns none.

Code clean-up

I am not as good with making sure my code is as nice as I should be, especially with some of the larger modules. Right now, I feel like I should take some time to go through each file and make it better.

Things to work on:
Cleanliness
Consistency with all other files

Access Violation error when using loadFromFile

I get Access Violation errors when I use any of the loadFromFile functions. That is for Texture, Font and Music classes. And I get the error only if my variables are not initialized. For example:

    Texture texture;
    if(!texture.loadFromFile("enemy.png")) // I get access violation here
    {
        stderr.writeln("Failed opening texture");
    }

But if I just change the first line to Texture texture = new Texture(); and then use the loadFromFile function the error goes away. And that is for all classes that have the loadFromFile function. Maybe this loadFromFile function should be made static and in it create a new object using the C pointer. But that might be just me.

Make a website?

Put some kind of website together.

I feel like it would be better for things like downloading binaries, tutorials, and documentation.

Forums should still probably stay at the main SFML website though.

EventType Error - SFML 2.1 and DSFML Experimental

Hi, i've compiled SFML 2.1 and DSFML-C with help from CMake, and then followed the rdmd compile advice for the experimental branch of DSFML. Everything went fine, and now i'm trying to get the short example from the wiki to work but every time i try to compile with dmd, i get this error:

main.d(29): Error: no property 'Closed' for type 'Event'

It's the only error i get. I've tried all sorts but just can't figure out what the problem is.
Btw, sorry if this is the wrong place for this. I can't find any decent DSFML forums and i'm at a bit of a loss.

This is my main.d:

//Compile with: dmd -IC:\DSFML-Experimental\src main.d

import std.stdio;
import dsfml.system.all;
import dsfml.window.all;
import dsfml.graphics.all;
import dsfml.audio.all;

pragma(lib, r"C:\DSFML-Experimental\lib\dsfml-system.lib");
pragma(lib, r"C:\DSFML-Experimental\lib\dsfml-window.lib");
pragma(lib, r"C:\DSFML-Experimental\lib\dsfml-graphics.lib");

void main()
{
    auto window = new RenderWindow(VideoMode(800, 600), "DSFML window");
    auto texture = new Texture();
    if(!texture.loadFromFile("cute_image.jpg")){
        return;
    }
    auto sprite = new Sprite(texture);
    auto font = new Font();
    if(!font.loadFromFile("arial.ttf")){
        return;
    }
    auto text = new Text("Hello DSFML", font, 50);
    while(window.isOpen()){
        Event event;
        while(window.pollEvent(event)){
            if(event.type == event.Closed){ //Line 29
                window.close();
            }
        }
        window.clear();
        window.draw(sprite);
        window.draw(text);
        window.display();
    }
}

New Master Branch

I know I have been saying it for quite some time, but this Saturday I'm actually going to do it 'll be switching out the matter branch fur the code in the experimental branch. I'm way behind in getting everything done that I want to have finished for when I announce DSFML on the D forums, but I think the experimental branch is far enough ahead of the CDFML version that it should be used instead.

I will be making an announcement on the SFML forums after I make the change to try to get people to use the new version to find any major issues(even though @aubade has been extremely helpful these last few days in taking down some serious bugs) while I keep writing some unit tests. I'll definitely be making the announcement on the D forums by the end of the month though.

Thanks to everyone that's been helping me out so far!

Experimental Branch: Unresolved symbols dsfml-audio

So, I've finally taken to playing a little with the Experimental branch, since SoundStream got implemented, and I'm having some difficulty--I think somewhere in the C wrapper or its build system. It purports to build and install the wrapper libraries just fine, but when I try to link them in for actual DSFML test code, I get these errors:

/usr/local/lib/libdsfml-audio.so: undefined reference to `sf::priv::SoundFile::openRead(sf::InputStream&)'
/usr/local/lib/libdsfml-audio.so: undefined reference to `sf::priv::SoundFile::getSampleCount() const'
/usr/local/lib/libdsfml-audio.so: undefined reference to `sf::priv::SoundFile::SoundFile()'
/usr/local/lib/libdsfml-audio.so: undefined reference to `sf::priv::SoundFile::getChannelCount() const'
/usr/local/lib/libdsfml-audio.so: undefined reference to `sf::priv::SoundFile::getSampleRate() const'
/usr/local/lib/libdsfml-audio.so: undefined reference to `sf::priv::SoundFile::openRead(void const*, unsigned long)'
/usr/local/lib/libdsfml-audio.so: undefined reference to `sf::priv::SoundFile::openWrite(std::string const&, unsigned int, unsigned int)'
/usr/local/lib/libdsfml-audio.so: undefined reference to `sf::priv::SoundFile::~SoundFile()'
/usr/local/lib/libdsfml-audio.so: undefined reference to `sf::priv::SoundFile::seek(sf::Time)'
/usr/local/lib/libdsfml-audio.so: undefined reference to `sf::priv::SoundFile::read(short*, unsigned long)'
/usr/local/lib/libdsfml-audio.so: undefined reference to `sf::priv::SoundFile::write(short const*, unsigned long)'
/usr/local/lib/libdsfml-audio.so: undefined reference to `sf::priv::SoundFile::openRead(std::string const&)'

I'm not sure if it the same vocabulary is used in whichever compiler infrastructure you usually, use, but in GNU/mingw ld-land, undefined references usually mean that a function was prototyped, but the implementation isn't being linked in properly. However, that doesn't seem to be the case here. libdsfml-audio.so is linked to libsfml-audio.so, and I've also tried manually linking the latter on the command line, to no effect.

It's also a bit odd to see unmangled names in the unresolved symbols. I've never played around much with C++ code, but at least with D code, unresolved symbol names show up mangled, but that might just be because ld knows C++ mangling but not D's.

DDoc documentation in code

Not only will this let the code be very well documented(which is something I've wanted to do for a while), but it also allows us to build stand alone documentation symilar to how SFML uses Doxygen for its documentation.

I'll probably wait until after the new C code base is finished before jumping into this, and will try to work on this at the same time as #20.

VideoMode.getDesktopMode produces error

I was sent an email by a user on Win XP 32 who told me they experience the following error:

VideoMode.getDesktopMode() causes an "object.Error: Access Violation" in "RegisterWaitForInputIdle" at runtime.

This is something that needs to be fixed. Any other Windows user encounter this error?

Experimental Branch: Font/Text doesn't work

It seems like somewhere between a Font and Text object set to use the font, something's breaking. If you add some trivial text to the smiley demo code, it doesn't actually display anything, and will crash the program at exit

module main;

import dsfml.graphics.all;

void main(string[] args)
{
    auto window = new RenderWindow(VideoMode(800,600),"Hello DSFML!");

    auto head = new CircleShape(100);
    head.fillColor = Color.Green;
    head.position = Vector2f(300,100);

    auto leftEye = new CircleShape(10);
    leftEye.fillColor = Color.Blue;
    leftEye.position = Vector2f(350,150);

    auto rightEye = new CircleShape(10);
    rightEye.fillColor = Color.Blue;
    rightEye.position = Vector2f(430,150);

    auto smile = new CircleShape(30);
    smile.fillColor = Color.Red;
    smile.position = Vector2f(368,200);

    auto smileCover = new RectangleShape(Vector2f(60,30));
    smileCover.fillColor = Color.Green;
    smileCover.position = Vector2f(368,200);

    auto font = new Font();
    font.loadFromFile("arial.ttf");

    auto text = new Text ("Hello!", font, 40);
    text.setColor(Color.White);

    while (window.isOpen())
    {
        Event event;

        while(window.pollEvent(event))
        {
            if(event.type == event.EventType.Closed)
            {
                window.close();
            }
        }

        window.clear();

        window.draw(head);
        window.draw(leftEye);
        window.draw(rightEye);
        window.draw(smile);
        window.draw(smileCover);
        window.draw(text);

        window.display();
    }
}

Using Constructors?

@nikibobi mentioned this to me a while back, and I wanted to make sure it wasn't forgotten.

The suggestion was to use constructors instead of the loadFromXXX methods for both initializing and loading data in one go.

The reason I currently do not use constructors for this is not just because it keeps it in sync with the SFML API, but because I think it is a more robust and simple way to catch loading errors.

Consider the following code for catching loading errors when initializing and loading a texture.

Load From version:

//definition
class Texture
{
     sfTexture* sfPtr;
     this()
     {
          //blank constructor
     }
     bool loadFromFile(string filename)
     {
          sfPtr = sfTexture_loadFromFile(filename);
          return (sfPtr is null)?false:true;
     }
}

//in use

void main()
{
     auto texture = new Texture();
     if(!texture.loadFromFile("Character.png"))
     {
          //loading failed
     }

     // do more stuff
}

Possible constructor version(how I would write it):

//definition
class Texture
{
     sfTexture* sfPtr;
     this(string filename)
     {
          sfPtr = sfTexture_loadFromFile(filename);
          //sfPtr is an internal implementation, so you need to check its validity here
          if(sfPtr is null)
          {
               throw new Exception("Couldn't load the file!");
          }
     }
}

//in use

void main()
{
     try {auto texture = new Texture("Character.png");}
     catch{//loading failed}

     // do more stuff
}

//or


void main()
{
     Texture texture;
     try {texture = new Texture("Character.png");}
     catch{//loading failed}

     // do more stuff
}

//and of course, if you know 100% the png exists
void main()
{
     auto texture = new Texture("Character.png");     

     // do more stuff
}

Thoughts?

Research Ranges

Ranges are a pretty fundamental part of D, but I don't know much about them.

I should research them more and try to figure out if they can be used anywhere in the binding.

Loading music from a stream crashes on play().

The following test program on my system works fine if the music is loaded from a file, but will crash at music.play() if the music was loaded from the stream.

import dsfml.audio.all;
import dsfml.system.inputstream;
import dsfml.window.all;
import dsfml.graphics.all;
import std.stdio;

class FileStream:InputStream { //simple InputStream based on D's File class
    private File file_;
    long getSize() {
        return file_.size;
    }

    long tell() {
        return file_.tell;
    }

    long seek (long posi) {
        file_.seek(posi);
        return file_.tell;
    }

    long read (void[] data) {
        data = file_.rawRead(data);
        return data.length;
    }

    this (string filename) {
        file_ = File(filename, "rb");
    }

    ~this () {
        debug writeln("Destroying FileStream");
    }
}

void main() {
    auto window = new RenderWindow(VideoMode(640, 480), "Test Streams");

    auto piccy = new Texture();
    auto imagestream = new FileStream("hello.png");

    piccy.loadFromStream(imagestream);
    auto sprity = new Sprite(piccy);

    auto musicstream = new FileStream ("test1.ogg");
    auto music = new Music();

    //uncomment one of these to test stream or file.
    //music.openFromStream(musicstream);
    //music.openFromFile("test1.ogg");

    music.play();
    while (window.isOpen())
    {
        Event event;

        while(window.pollEvent(event))
        {
            if(event.type == event.EventType.Closed)
            {
                window.close();
            }
        }

        window.draw(sprity);



        window.display();
    }
    music.stop();

}

contrary to my previous report, this happens in DMD and GDC, regardless of compiler optimization.

Include Unit Tests

This will help ensure that things are working properly across the board, and will make sure that nothing was forgotten/left out.

Update building totorial

There are a couple of things that need to be updated in the tutorial. A couple of people have found some things a tad confusing and one part needs to be expanded on.

Confusing:
The part on the naming convention for the libraries. Rewrite as a new section to be incorporated in to the stuff below.
Expanded:
The usage of implib for Windows. I left a part out(didn't realize it) and I can talk about the naming stuff here.

CircleShape getting/setting origin crashes

When I create new CircleShape and try to get it's origin or set it the game crashes with:

object.Error: Access Violation
----------------
0x0041AE88
0x0041AD13
0x7C9032A8
0x7C90327A
0x7C90E48A
0x00404116
0x0040EA4C
0x0040EA86
0x0040E6A8
0x004243BD
0x7C81776F
----------------

Here is sample code that you can test:

import dsfml.system;
import dsfml.window;
import dsfml.graphics;
import std.stdio;

void main()
{
    CircleShape shape = new CircleShape(10);
    shape.origin = Vector2f(5,5); //or writeln(shape.origin)
}

I have tried it with RectangleShape and it works. This is only in CircleShape class.

loadFrom methods should delete internal pointer before loading

The loadFrom methods currently create a new sf object with out deleting the current one first. If someone was to use loadFrom multiple times one the same object it would cause a memory leak. All loadFrom methods should delete the pointer first, and then attempt to create the new object.

Vector3 typo

system.d:407, 411 have a typo: otherVctor should be otherVector

Working SoundRecorder base class

Implement a class that has a nice front end for users to make nice recorders and use it to make the SoundBufferRecorder class to verifies it works correctly.

Working InputStream class

Implement a class in D that is based off of SFML's InputSteam class.

The ideal would be an extern(C++) Interface since that would match SFML's directly, but with the binding currently being based off of CSFML, I had to get creative.

I have some code that I think will work, I just need some time to actually test it.

SFML 2.1 Updates

There were some changes that I will need to take into account after I finish the next version of DSFML(which isn't too far off), specifically some fixes in the audio parts that were done when SFML went from 2.0 to 2.1.

This is just a little reminder to myself to do it. :)

Rewrite Audio classes with straight OpenAL code

Once the OpenAL header is made in D code(probably using htod), the Audio classes should be rewritten with straight OpenAL code. This will remove the CMake dependency for OpenAL and will simplify the C code building.

Various issues on 64bit Linux

DMD supports 64-bit compilation on linux, but there's a couple issues. Using the DMD 2.062 compiler.

  1. graphics.d's vertex handling code passes the .length property--of type size_t (64 bits long on a 64bit compiler), to CSFML functions that want a uint (always 32 bits)

  2. There are some functions that default to TLS, that make gcc's linker complain

  3. dmd whines that a couple default struct initializers aren't lvalues. this might be a compiler bug?

attached is a patch that tackles all three, making it compile, and work for a simple test program.

diff --git a/dsfml/graphics.d b/dsfml/graphics.d
index 655b04e..c383cf4 100644
--- a/dsfml/graphics.d
+++ b/dsfml/graphics.d
@@ -22,6 +22,8 @@ import std.utf;
 
  import std.stdio;
 
+RenderStates DefaultRenderStates = RenderStates();
+
 public
 {
    import dsfml.window;
@@ -1004,9 +1006,9 @@ abstract class RenderTarget
 
    package bool IsRenderWindow;
 
-   void draw(Drawable drawable, ref RenderStates states = RenderStates());
+   void draw(Drawable drawable, ref RenderStates states = DefaultRenderStates);
    
-   void draw(const Vertex[] vertices, PrimitiveType type, ref RenderStates states = RenderStates());
+   void draw(const Vertex[] vertices, PrimitiveType type, ref RenderStates states = DefaultRenderStates);
 }
 
 class RenderTexture:RenderTarget
@@ -1098,15 +1100,15 @@ class RenderTexture:RenderTarget
 
 
 
-   void draw(Drawable drawable, ref RenderStates states = RenderStates())
+   void draw(Drawable drawable, ref RenderStates states = DefaultRenderStates)
    {
 
        drawable.draw(this, states);
    }
    
-   void draw(const Vertex[] vertices, PrimitiveType type, ref RenderStates states = RenderStates())
+   void draw(const Vertex[] vertices, PrimitiveType type, ref RenderStates states = DefaultRenderStates)
    {
-       sfRenderTexture_drawPrimitives(sfPtr, vertices.ptr, vertices.length,type,&states.tosfRenderStates());
+       sfRenderTexture_drawPrimitives(sfPtr, vertices.ptr, cast(uint)min(uint.max, vertices.length),type,&states.tosfRenderStates());
    }
    
    void display()
@@ -1133,13 +1135,13 @@ class RenderWindow:RenderTarget
    package alias WindowPtr sfPtr;
    
        
-   this(VideoMode mode, string title, uint style = Window.Style.DefaultStyle,  ref ContextSettings settings = ContextSettings())
+   this(VideoMode mode, string title, uint style = Window.Style.DefaultStyle,  ref ContextSettings settings = DefaultContextSettings)
    {
        sfPtr = sfRenderWindow_create(mode,toStringz(title),style,&settings);
        IsRenderWindow = true;
    }
 
-   this(WindowHandle handle, ref ContextSettings settings = ContextSettings())
+   this(WindowHandle handle, ref ContextSettings settings = DefaultContextSettings)
    {
        sfPtr = sfRenderWindow_createFromHandle(handle,&settings);
        IsRenderWindow = true;
@@ -1235,14 +1237,14 @@ class RenderWindow:RenderTarget
        return (sfRenderWindow_isOpen(sfPtr) == sfTrue)? true: false;
    }
 
-   void draw(Drawable drawable, ref RenderStates states = RenderStates())
+   void draw(Drawable drawable, ref RenderStates states = DefaultRenderStates)
    {   
        drawable.draw(this, states);
    }
    
-   void draw(const Vertex[] vertices, PrimitiveType type, ref RenderStates states = RenderStates())
+   void draw(const Vertex[] vertices, PrimitiveType type, ref RenderStates states = DefaultRenderStates)
    {
-       sfRenderWindow_drawPrimitives(sfPtr, vertices.ptr, vertices.length, type, &states.tosfRenderStates());
+       sfRenderWindow_drawPrimitives(sfPtr, vertices.ptr, cast(uint)min(uint.max, vertices.length), type, &states.tosfRenderStates());
    }
    
    void setVerticalSyncEnabled(bool enabled)
@@ -2014,7 +2016,7 @@ class VertexArray:Drawable
    
    uint getVertexCount()
    {
-       return Vertices.length;
+       return cast(uint)min(uint.max, Vertices.length);
    }
    
 
@@ -2060,8 +2062,8 @@ class VertexArray:Drawable
    override void draw(RenderTarget renderTarget, ref RenderStates renderStates)
    {
        renderTarget.IsRenderWindow?
-           sfRenderWindow_drawPrimitives(renderTarget.WindowPtr,Vertices.ptr,Vertices.length,primativeType,&renderStates.tosfRenderStates()):
-               sfRenderTexture_drawPrimitives(renderTarget.TexturePtr,Vertices.ptr,Vertices.length,primativeType,&renderStates.tosfRenderStates());
+           sfRenderWindow_drawPrimitives(renderTarget.WindowPtr,Vertices.ptr,cast(uint)min(uint.max, Vertices.length),primativeType,&renderStates.tosfRenderStates()):
+               sfRenderTexture_drawPrimitives(renderTarget.TexturePtr,Vertices.ptr,cast(uint)min(uint.max, Vertices.length),primativeType,&renderStates.tosfRenderStates());
            
    }
 
@@ -2628,14 +2630,14 @@ extern(C)
    void sfCircleShape_setPosition(sfCircleShape* shape,sfVector2f position);
    void sfCircleShape_setRotation(sfCircleShape* shape,float angle);
    void sfCircleShape_setScale(sfCircleShape* shape,sfVector2f scale);
-   void function(sfCircleShape* shape,sfVector2f origin) sfCircleShape_setOrigin;
-   sfVector2f function(const(sfCircleShape)* shape) sfCircleShape_getPosition;
-   float function(const(sfCircleShape)* shape) sfCircleShape_getRotation;
-   sfVector2f function(const(sfCircleShape)* shape) sfCircleShape_getScale;
-   sfVector2f function(const(sfCircleShape)* shape) sfCircleShape_getOrigin;
-   void function(sfCircleShape* shape,sfVector2f offset) sfCircleShape_move;
-   void function(sfCircleShape* shape,float angle) sfCircleShape_rotate;
-   void function(sfCircleShape* shape,sfVector2f factors) sfCircleShape_scale;
+   __gshared void function(sfCircleShape* shape,sfVector2f origin) sfCircleShape_setOrigin;
+   __gshared sfVector2f function(const(sfCircleShape)* shape) sfCircleShape_getPosition;
+   __gshared float function(const(sfCircleShape)* shape) sfCircleShape_getRotation;
+   __gshared sfVector2f function(const(sfCircleShape)* shape) sfCircleShape_getScale;
+   __gshared sfVector2f function(const(sfCircleShape)* shape) sfCircleShape_getOrigin;
+   __gshared void function(sfCircleShape* shape,sfVector2f offset) sfCircleShape_move;
+   __gshared void function(sfCircleShape* shape,float angle) sfCircleShape_rotate;
+   __gshared void function(sfCircleShape* shape,sfVector2f factors) sfCircleShape_scale;
    sfTransform  sfCircleShape_getTransform(const(sfCircleShape)* shape);
    sfTransform sfCircleShape_getInverseTransform(const(sfCircleShape)* shape);
    void sfCircleShape_setTexture(sfCircleShape* shape,const(sfTexture)* texture,sfBool resetRect);
diff --git a/dsfml/window.d b/dsfml/window.d
index b8829b4..3accd3e 100644
--- a/dsfml/window.d
+++ b/dsfml/window.d
@@ -20,6 +20,8 @@ import core.stdc.config;
 
 debug import std.stdio;
 
+immutable ContextSettings DefaultContextSettings = ContextSettings();
+
 public
 {
    import dsfml.system;
@@ -66,13 +68,13 @@ class Window
    package sfWindow* sfPtr;
 
 
-   this(VideoMode mode, string title, Style style = Style.DefaultStyle,  ref ContextSettings settings = ContextSettings())
+   this(VideoMode mode, string title, Style style = Style.DefaultStyle,  ref ContextSettings settings = DefaultContextSettings)
    {
        sfPtr = sfWindow_create(mode, toStringz(title) , style, &settings);
    }
 
 
-   this(WindowHandle handle, ref ContextSettings settings = ContextSettings())
+   this(WindowHandle handle, ref ContextSettings settings = DefaultContextSettings)
    {
        sfPtr = sfWindow_createFromHandle(handle,  &settings);
    }

Experimental Branch: draw() methods crash when a RenderStates is passed.

I'm not sure exactly what's going on with this, but when I pass a RenderStates along with a draw operation, it makes the program crash. It does this with my projcet that uses them extensively, and I was able to modify your smiley face example code to do it too.

module main;

import dsfml.graphics.all;

void main(string[] args)
{
    auto window = new RenderWindow(VideoMode(800,600),"Hello DSFML!");

    auto head = new CircleShape(100);
    head.fillColor = Color.Green;
    head.position = Vector2f(300,100);

    auto leftEye = new CircleShape(10);
    leftEye.fillColor = Color.Blue;
    leftEye.position = Vector2f(350,150);

    auto rightEye = new CircleShape(10);
    rightEye.fillColor = Color.Blue;
    rightEye.position = Vector2f(430,150);

    auto smile = new CircleShape(30);
    smile.fillColor = Color.Red;
    smile.position = Vector2f(368,200);

    auto smileCover = new RectangleShape(Vector2f(60,30));
    smileCover.fillColor = Color.Green;
    smileCover.position = Vector2f(368,200);

    RenderStates statey;

    while (window.isOpen())
    {
        Event event;

        while(window.pollEvent(event))
        {
            if(event.type == event.EventType.Closed)
            {
                window.close();
            }
        }

        window.clear();

        window.draw(head, statey);
        window.draw(leftEye);
        window.draw(rightEye);
        window.draw(smile);
        window.draw(smileCover);

        window.display();
    }
}

will segfault on my system at the line window.draw(head, statey);.

build.d

Libraries like Derelict and GtkD have a special build.d file that greatly simplifies the building process for their own static library files by using rdmd(and the gdc/ldc versions of rdmd).

I'd like to do something like that for DSFML. Not only will this speed up the building process by making it a single step, it is less error prone and allows users to build DSFML in different ways(They only want to use specific modules, they want to build the documentation, etc.).

Someone else is welcome to work on this, but please be warned that a new version will have to be written for when the second version of DSFML is done. only slight modifications will need to be done to get it working, though. If no one makes one by then I'll do it before I work on the documentation.

If possible I'd like it to work for Win/Mac/Linux as well as DMD/GDC/LDC.

RenderStates clobbered by *Shapes?

I've been working around this behavior in my code for some time, and it only just occured to me it might not be expected behavior. But it appears that at least the Transform, and possibly the texture of any RenderStates passed to the draw method of a shape get clobbered by it.

So, for example, if I'm drawing multiple RectangleShapes, I have to make a new RenderStates for each, to make them positioned properly. However, raw VertexArrays, or Sprites, don't seem to be changing the RenderStates passed to them. I seem to be able to share a single States between multiple.

Is this what should be happening?

Write some tutorials

Tutorials, man. We should get some and post them in the wiki.

Other people are definitely welcome to jump into this since it will probably be a bit before I can work on these. My plan was to simply recreate Laurent's tutorials.

Be aware that they will have to be updated once the new version is released, but that should should only be a minimal amount of work to do so.

Update CMake files

The files for CSFML were recently updated, which means I get to go through and check them out to see what I can update in DSFML-C!

I know that some people have been having issues building the library, so I want to see if there's some way that I can improve the CMake stuff to make it better in general. Perhaps I can incorporate stuff from the main SFML CMake files and the CSFML ones to make the system more robust or something.

Groogy(one of the forum/irc goers) also suggested that implib be integrated into the build system so that for DMD 32 for windows it will make the import libraries for you. That would be cool. I'll look into it.

Problem Building on OS X Mavericks

Hey there... I tried following the tutorial (including building my static libraries from SFML by hand), but am running into the following.

Configuration works fine. Generating the Makefile works fine. Here's my CMake setup:

screenshot 2013-11-07 16 21 12
screenshot 2013-11-07 16 21 19

And here's what I hit with bash:

[jared@Adam-Smith DSFML-C Build (master)]$ make
[  5%] Built target dsfml-system
Linking CXX shared library ../../../lib/libdsfml-window.dylib
Undefined symbols for architecture x86_64:
  "_CFArrayCreate", referenced from:
      sf::priv::HIDJoystickManager::HIDJoystickManager() in libsfml-window-s.a(HIDJoystickManager.cpp.o)
  "_CFArrayGetCount", referenced from:
      sf::priv::VideoModeImpl::getFullscreenModes() in libsfml-window-s.a(VideoModeImpl.cpp.o)
      sf::priv::JoystickImpl::open(unsigned int) in libsfml-window-s.a(JoystickImpl.cpp.o)
      sf::priv::HIDInputManager::loadKeyboard(__IOHIDDevice*) in libsfml-window-s.a(HIDInputManager.mm.o)
      sf::priv::HIDInputManager::loadMouse(__IOHIDDevice*) in libsfml-window-s.a(HIDInputManager.mm.o)
      sf::priv::convertSFModeToCGMode(sf::VideoMode) in libsfml-window-s.a(cg_sf_conversion.cpp.o)
  "_CFArrayGetValueAtIndex", referenced from:
      sf::priv::VideoModeImpl::getFullscreenModes() in libsfml-window-s.a(VideoModeImpl.cpp.o)
      sf::priv::JoystickImpl::open(unsigned int) in libsfml-window-s.a(JoystickImpl.cpp.o)
      sf::priv::HIDInputManager::loadKeyboard(__IOHIDDevice*) in libsfml-window-s.a(HIDInputManager.mm.o)
      sf::priv::HIDInputManager::loadMouse(__IOHIDDevice*) in libsfml-window-s.a(HIDInputManager.mm.o)
      sf::priv::convertSFModeToCGMode(sf::VideoMode) in libsfml-window-s.a(cg_sf_conversion.cpp.o)
  "_CFDataGetBytePtr", referenced from:
      sf::priv::HIDInputManager::HIDInputManager() in libsfml-window-s.a(HIDInputManager.mm.o)
  "_CFDictionaryCreateMutable", referenced from:
      sf::priv::HIDInputManager::copyDevicesMask(unsigned int, unsigned int) in libsfml-window-s.a(HIDInputManager.mm.o)
      sf::priv::HIDInputManager::copyDevices(unsigned int, unsigned int) in libsfml-window-s.a(HIDInputManager.mm.o)
  "_CFDictionarySetValue", referenced from:
      sf::priv::HIDInputManager::copyDevicesMask(unsigned int, unsigned int) in libsfml-window-s.a(HIDInputManager.mm.o)
      sf::priv::HIDInputManager::copyDevices(unsigned int, unsigned int) in libsfml-window-s.a(HIDInputManager.mm.o)
  "_CFGetTypeID", referenced from:
      sf::priv::HIDInputManager::getLocationID(__IOHIDDevice*) in libsfml-window-s.a(HIDInputManager.mm.o)
  "_CFNumberCreate", referenced from:
      sf::priv::HIDInputManager::copyDevicesMask(unsigned int, unsigned int) in libsfml-window-s.a(HIDInputManager.mm.o)
      sf::priv::HIDInputManager::copyDevices(unsigned int, unsigned int) in libsfml-window-s.a(HIDInputManager.mm.o)
  "_CFNumberGetTypeID", referenced from:
      sf::priv::HIDInputManager::getLocationID(__IOHIDDevice*) in libsfml-window-s.a(HIDInputManager.mm.o)
  "_CFNumberGetValue", referenced from:
      sf::priv::HIDInputManager::getLocationID(__IOHIDDevice*) in libsfml-window-s.a(HIDInputManager.mm.o)
  "_CFRelease", referenced from:
      sf::priv::VideoModeImpl::getFullscreenModes() in libsfml-window-s.a(VideoModeImpl.cpp.o)
      sf::priv::InputImpl::setMousePosition(sf::Vector2<int> const&) in libsfml-window-s.a(InputImpl.mm.o)
      sf::priv::InputImpl::setMousePosition(sf::Vector2<int> const&, sf::Window const&) in libsfml-window-s.a(InputImpl.mm.o)
      sf::priv::JoystickImpl::isConnected(unsigned int) in libsfml-window-s.a(JoystickImpl.cpp.o)
      sf::priv::JoystickImpl::open(unsigned int) in libsfml-window-s.a(JoystickImpl.cpp.o)
      sf::priv::JoystickImpl::close() in libsfml-window-s.a(JoystickImpl.cpp.o)
      sf::priv::JoystickImpl::update() in libsfml-window-s.a(JoystickImpl.cpp.o)
      ...
  "_CFRetain", referenced from:
      sf::priv::JoystickImpl::open(unsigned int) in libsfml-window-s.a(JoystickImpl.cpp.o)
      sf::priv::HIDInputManager::HIDInputManager() in libsfml-window-s.a(HIDInputManager.mm.o)
      sf::priv::HIDInputManager::loadMouse(__IOHIDDevice*) in libsfml-window-s.a(HIDInputManager.mm.o)
      sf::priv::HIDInputManager::loadKey(__IOHIDElement*) in libsfml-window-s.a(HIDInputManager.mm.o)
      sf::priv::HIDInputManager::loadButton(__IOHIDElement*) in libsfml-window-s.a(HIDInputManager.mm.o)
  "_CFRunLoopGetCurrent", referenced from:
      sf::priv::HIDJoystickManager::~HIDJoystickManager() in libsfml-window-s.a(HIDJoystickManager.cpp.o)
      sf::priv::HIDJoystickManager::HIDJoystickManager() in libsfml-window-s.a(HIDJoystickManager.cpp.o)
      sf::priv::HIDJoystickManager::~HIDJoystickManager() in libsfml-window-s.a(HIDJoystickManager.cpp.o)
  "_CFRunLoopRunInMode", referenced from:
      sf::priv::HIDJoystickManager::getJoystickCount() in libsfml-window-s.a(HIDJoystickManager.cpp.o)
      sf::priv::HIDJoystickManager::update() in libsfml-window-s.a(HIDJoystickManager.cpp.o)
  "_CFSetGetCount", referenced from:
      sf::priv::JoystickImpl::isConnected(unsigned int) in libsfml-window-s.a(JoystickImpl.cpp.o)
      sf::priv::JoystickImpl::open(unsigned int) in libsfml-window-s.a(JoystickImpl.cpp.o)
      sf::priv::JoystickImpl::update() in libsfml-window-s.a(JoystickImpl.cpp.o)
      sf::priv::HIDInputManager::initializeKeyboard() in libsfml-window-s.a(HIDInputManager.mm.o)
      sf::priv::HIDInputManager::initializeMouse() in libsfml-window-s.a(HIDInputManager.mm.o)
      sf::priv::HIDInputManager::copyDevices(unsigned int, unsigned int) in libsfml-window-s.a(HIDInputManager.mm.o)
  "_CFSetGetValues", referenced from:
      sf::priv::JoystickImpl::isConnected(unsigned int) in libsfml-window-s.a(JoystickImpl.cpp.o)
      sf::priv::JoystickImpl::open(unsigned int) in libsfml-window-s.a(JoystickImpl.cpp.o)
      sf::priv::JoystickImpl::update() in libsfml-window-s.a(JoystickImpl.cpp.o)
      sf::priv::HIDInputManager::initializeKeyboard() in libsfml-window-s.a(HIDInputManager.mm.o)
      sf::priv::HIDInputManager::initializeMouse() in libsfml-window-s.a(HIDInputManager.mm.o)
  "_CFStringCompare", referenced from:
      sf::priv::modeBitsPerPixel(CGDisplayMode*) in libsfml-window-s.a(cg_sf_conversion.cpp.o)
      sf::priv::displayBitsPerPixel(unsigned int) in libsfml-window-s.a(cg_sf_conversion.cpp.o)
      sf::priv::convertCGModeToSFMode(CGDisplayMode*) in libsfml-window-s.a(cg_sf_conversion.cpp.o)
  "_CGDisplayCopyAllDisplayModes", referenced from:
      sf::priv::VideoModeImpl::getFullscreenModes() in libsfml-window-s.a(VideoModeImpl.cpp.o)
      sf::priv::convertSFModeToCGMode(sf::VideoMode) in libsfml-window-s.a(cg_sf_conversion.cpp.o)
  "_CGDisplayCopyDisplayMode", referenced from:
      sf::priv::displayBitsPerPixel(unsigned int) in libsfml-window-s.a(cg_sf_conversion.cpp.o)
  "_CGDisplayModeCopyPixelEncoding", referenced from:
      sf::priv::modeBitsPerPixel(CGDisplayMode*) in libsfml-window-s.a(cg_sf_conversion.cpp.o)
      sf::priv::displayBitsPerPixel(unsigned int) in libsfml-window-s.a(cg_sf_conversion.cpp.o)
      sf::priv::convertCGModeToSFMode(CGDisplayMode*) in libsfml-window-s.a(cg_sf_conversion.cpp.o)
  "_CGDisplayModeGetHeight", referenced from:
      sf::priv::convertCGModeToSFMode(CGDisplayMode*) in libsfml-window-s.a(cg_sf_conversion.cpp.o)
  "_CGDisplayModeGetWidth", referenced from:
      sf::priv::convertCGModeToSFMode(CGDisplayMode*) in libsfml-window-s.a(cg_sf_conversion.cpp.o)
  "_CGDisplayModeRelease", referenced from:
      sf::priv::displayBitsPerPixel(unsigned int) in libsfml-window-s.a(cg_sf_conversion.cpp.o)
  "_CGDisplayPixelsHigh", referenced from:
      sf::priv::VideoModeImpl::getDesktopMode() in libsfml-window-s.a(VideoModeImpl.cpp.o)
      -[SFWindowController screenHeight] in libsfml-window-s.a(SFWindowController.mm.o)
  "_CGDisplayPixelsWide", referenced from:
      sf::priv::VideoModeImpl::getDesktopMode() in libsfml-window-s.a(VideoModeImpl.cpp.o)
  "_CGEventCreateMouseEvent", referenced from:
      sf::priv::InputImpl::setMousePosition(sf::Vector2<int> const&) in libsfml-window-s.a(InputImpl.mm.o)
      sf::priv::InputImpl::setMousePosition(sf::Vector2<int> const&, sf::Window const&) in libsfml-window-s.a(InputImpl.mm.o)
  "_CGEventPost", referenced from:
      sf::priv::InputImpl::setMousePosition(sf::Vector2<int> const&) in libsfml-window-s.a(InputImpl.mm.o)
      sf::priv::InputImpl::setMousePosition(sf::Vector2<int> const&, sf::Window const&) in libsfml-window-s.a(InputImpl.mm.o)
  "_CGLEnable", referenced from:
      -[SFWindowController applyContext:] in libsfml-window-s.a(SFWindowController.mm.o)
  "_CGLSetParameter", referenced from:
      -[SFWindowController applyContext:] in libsfml-window-s.a(SFWindowController.mm.o)
  "_CGMainDisplayID", referenced from:
      sf::priv::VideoModeImpl::getFullscreenModes() in libsfml-window-s.a(VideoModeImpl.cpp.o)
      sf::priv::VideoModeImpl::getDesktopMode() in libsfml-window-s.a(VideoModeImpl.cpp.o)
      sf::priv::convertSFModeToCGMode(sf::VideoMode) in libsfml-window-s.a(cg_sf_conversion.cpp.o)
  "_CGWindowLevelForKey", referenced from:
      -[SFWindowController initWithMode:andStyle:] in libsfml-window-s.a(SFWindowController.mm.o)
  "_GetCurrentProcess", referenced from:
      sf::priv::WindowImplCocoa::WindowImplCocoa(sf::VideoMode, sf::String const&, unsigned long, sf::ContextSettings const&) in libsfml-window-s.a(WindowImplCocoa.mm.o)
      sf::priv::WindowImplCocoa::WindowImplCocoa(sf::VideoMode, sf::String const&, unsigned long, sf::ContextSettings const&) in libsfml-window-s.a(WindowImplCocoa.mm.o)
      sf::priv::WindowImplCocoa::setUpProcess() in libsfml-window-s.a(WindowImplCocoa.mm.o)
  "_IOHIDDeviceCopyMatchingElements", referenced from:
      sf::priv::JoystickImpl::open(unsigned int) in libsfml-window-s.a(JoystickImpl.cpp.o)
      sf::priv::HIDInputManager::loadKeyboard(__IOHIDDevice*) in libsfml-window-s.a(HIDInputManager.mm.o)
      sf::priv::HIDInputManager::loadMouse(__IOHIDDevice*) in libsfml-window-s.a(HIDInputManager.mm.o)
  "_IOHIDDeviceGetProperty", referenced from:
      sf::priv::HIDInputManager::getLocationID(__IOHIDDevice*) in libsfml-window-s.a(HIDInputManager.mm.o)
  "_IOHIDDeviceGetValue", referenced from:
      sf::priv::JoystickImpl::update() in libsfml-window-s.a(JoystickImpl.cpp.o)
      sf::priv::HIDInputManager::isKeyPressed(sf::Keyboard::Key) in libsfml-window-s.a(HIDInputManager.mm.o)
      sf::priv::HIDInputManager::isMouseButtonPressed(sf::Mouse::Button) in libsfml-window-s.a(HIDInputManager.mm.o)
  "_IOHIDElementGetDevice", referenced from:
      sf::priv::JoystickImpl::update() in libsfml-window-s.a(JoystickImpl.cpp.o)
      sf::priv::HIDInputManager::isKeyPressed(sf::Keyboard::Key) in libsfml-window-s.a(HIDInputManager.mm.o)
      sf::priv::HIDInputManager::isMouseButtonPressed(sf::Mouse::Button) in libsfml-window-s.a(HIDInputManager.mm.o)
  "_IOHIDElementGetPhysicalMax", referenced from:
      sf::priv::JoystickImpl::update() in libsfml-window-s.a(JoystickImpl.cpp.o)
  "_IOHIDElementGetPhysicalMin", referenced from:
      sf::priv::JoystickImpl::update() in libsfml-window-s.a(JoystickImpl.cpp.o)
  "_IOHIDElementGetType", referenced from:
      sf::priv::JoystickImpl::open(unsigned int) in libsfml-window-s.a(JoystickImpl.cpp.o)
  "_IOHIDElementGetUsage", referenced from:
      sf::priv::JoystickImpl::open(unsigned int) in libsfml-window-s.a(JoystickImpl.cpp.o)
      (anonymous namespace)::JoystickButtonSortPredicate(__IOHIDElement*, __IOHIDElement*) in libsfml-window-s.a(JoystickImpl.cpp.o)
      sf::priv::HIDInputManager::loadMouse(__IOHIDDevice*) in libsfml-window-s.a(HIDInputManager.mm.o)
      sf::priv::HIDInputManager::loadKey(__IOHIDElement*) in libsfml-window-s.a(HIDInputManager.mm.o)
      sf::priv::HIDInputManager::loadButton(__IOHIDElement*) in libsfml-window-s.a(HIDInputManager.mm.o)
  "_IOHIDElementGetUsagePage", referenced from:
      sf::priv::HIDInputManager::loadKeyboard(__IOHIDDevice*) in libsfml-window-s.a(HIDInputManager.mm.o)
      sf::priv::HIDInputManager::loadMouse(__IOHIDDevice*) in libsfml-window-s.a(HIDInputManager.mm.o)
  "_IOHIDManagerClose", referenced from:
      sf::priv::HIDJoystickManager::~HIDJoystickManager() in libsfml-window-s.a(HIDJoystickManager.cpp.o)
      sf::priv::HIDJoystickManager::~HIDJoystickManager() in libsfml-window-s.a(HIDJoystickManager.cpp.o)
  "_IOHIDManagerCopyDevices", referenced from:
      sf::priv::HIDInputManager::copyDevices(unsigned int, unsigned int) in libsfml-window-s.a(HIDInputManager.mm.o)
      sf::priv::HIDJoystickManager::copyJoysticks() in libsfml-window-s.a(HIDJoystickManager.cpp.o)
  "_IOHIDManagerCreate", referenced from:
      sf::priv::HIDInputManager::HIDInputManager() in libsfml-window-s.a(HIDInputManager.mm.o)
      sf::priv::HIDJoystickManager::HIDJoystickManager() in libsfml-window-s.a(HIDJoystickManager.cpp.o)
  "_IOHIDManagerOpen", referenced from:
      sf::priv::HIDInputManager::HIDInputManager() in libsfml-window-s.a(HIDInputManager.mm.o)
      sf::priv::HIDJoystickManager::HIDJoystickManager() in libsfml-window-s.a(HIDJoystickManager.cpp.o)
  "_IOHIDManagerRegisterDeviceMatchingCallback", referenced from:
      sf::priv::HIDJoystickManager::~HIDJoystickManager() in libsfml-window-s.a(HIDJoystickManager.cpp.o)
      sf::priv::HIDJoystickManager::HIDJoystickManager() in libsfml-window-s.a(HIDJoystickManager.cpp.o)
      sf::priv::HIDJoystickManager::~HIDJoystickManager() in libsfml-window-s.a(HIDJoystickManager.cpp.o)
  "_IOHIDManagerRegisterDeviceRemovalCallback", referenced from:
      sf::priv::HIDJoystickManager::~HIDJoystickManager() in libsfml-window-s.a(HIDJoystickManager.cpp.o)
      sf::priv::HIDJoystickManager::HIDJoystickManager() in libsfml-window-s.a(HIDJoystickManager.cpp.o)
      sf::priv::HIDJoystickManager::~HIDJoystickManager() in libsfml-window-s.a(HIDJoystickManager.cpp.o)
  "_IOHIDManagerScheduleWithRunLoop", referenced from:
      sf::priv::HIDJoystickManager::HIDJoystickManager() in libsfml-window-s.a(HIDJoystickManager.cpp.o)
  "_IOHIDManagerSetDeviceMatching", referenced from:
      sf::priv::HIDInputManager::copyDevices(unsigned int, unsigned int) in libsfml-window-s.a(HIDInputManager.mm.o)
  "_IOHIDManagerSetDeviceMatchingMultiple", referenced from:
      sf::priv::HIDJoystickManager::HIDJoystickManager() in libsfml-window-s.a(HIDJoystickManager.cpp.o)
  "_IOHIDManagerUnscheduleFromRunLoop", referenced from:
      sf::priv::HIDJoystickManager::~HIDJoystickManager() in libsfml-window-s.a(HIDJoystickManager.cpp.o)
      sf::priv::HIDJoystickManager::~HIDJoystickManager() in libsfml-window-s.a(HIDJoystickManager.cpp.o)
  "_IOHIDValueGetIntegerValue", referenced from:
      sf::priv::JoystickImpl::update() in libsfml-window-s.a(JoystickImpl.cpp.o)
      sf::priv::HIDInputManager::isKeyPressed(sf::Keyboard::Key) in libsfml-window-s.a(HIDInputManager.mm.o)
      sf::priv::HIDInputManager::isMouseButtonPressed(sf::Mouse::Button) in libsfml-window-s.a(HIDInputManager.mm.o)
  "_IOHIDValueGetScaledValue", referenced from:
      sf::priv::JoystickImpl::update() in libsfml-window-s.a(JoystickImpl.cpp.o)
  "_LMGetKbdType", referenced from:
      sf::priv::HIDInputManager::loadKey(__IOHIDElement*) in libsfml-window-s.a(HIDInputManager.mm.o)
  "_NSApp", referenced from:
      +[SFApplication processEvent] in libsfml-window-s.a(SFApplication.m.o)
      ensureModifiersStateIsInitilized() in libsfml-window-s.a(SFKeyboardModifiersHelper.mm.o)
      processOneModifier(unsigned long, unsigned long, signed char&, sf::Keyboard::Key, sf::priv::WindowImplCocoa&) in libsfml-window-s.a(SFKeyboardModifiersHelper.mm.o)
  "_NSCalibratedRGBColorSpace", referenced from:
      -[SFWindowController setIconTo:by:with:] in libsfml-window-s.a(SFWindowController.mm.o)
  "_NSDefaultRunLoopMode", referenced from:
      +[SFApplication processEvent] in libsfml-window-s.a(SFApplication.m.o)
  "_NSEqualSizes", referenced from:
      -[SFOpenGLView computeGlobalPositionOfRelativePoint:] in libsfml-window-s.a(SFOpenGLView.mm.o)
      -[SFOpenGLView cursorPositionFromEvent:] in libsfml-window-s.a(SFOpenGLView.mm.o)
  "_NSPointInRect", referenced from:
      -[SFOpenGLView isMouseInside] in libsfml-window-s.a(SFOpenGLView.mm.o)
  "_NSViewFrameDidChangeNotification", referenced from:
      -[SFOpenGLView initWithFrame:] in libsfml-window-s.a(SFOpenGLView.mm.o)
  "_NSZeroRect", referenced from:
      -[SFOpenGLView initWithFrame:] in libsfml-window-s.a(SFOpenGLView.mm.o)
  "_NSZeroSize", referenced from:
      -[SFOpenGLView initWithFrame:] in libsfml-window-s.a(SFOpenGLView.mm.o)
      -[SFOpenGLView computeGlobalPositionOfRelativePoint:] in libsfml-window-s.a(SFOpenGLView.mm.o)
      -[SFOpenGLView cursorPositionFromEvent:] in libsfml-window-s.a(SFOpenGLView.mm.o)
  "_OBJC_CLASS_$_NSApplication", referenced from:
      _OBJC_CLASS_$_SFApplication in libsfml-window-s.a(SFApplication.m.o)
  "_OBJC_CLASS_$_NSArray", referenced from:
      objc-class-ref in libsfml-window-s.a(SFOpenGLView.mm.o)
  "_OBJC_CLASS_$_NSAutoreleasePool", referenced from:
      objc-class-ref in libsfml-window-s.a(AutoreleasePoolWrapper.mm.o)
  "_OBJC_CLASS_$_NSBitmapImageRep", referenced from:
      objc-class-ref in libsfml-window-s.a(SFWindowController.mm.o)
  "_OBJC_CLASS_$_NSCursor", referenced from:
      objc-class-ref in libsfml-window-s.a(SFViewController.mm.o)
      objc-class-ref in libsfml-window-s.a(SFWindowController.mm.o)
  "_OBJC_CLASS_$_NSDate", referenced from:
      objc-class-ref in libsfml-window-s.a(SFApplication.m.o)
  "_OBJC_CLASS_$_NSEvent", referenced from:
      objc-class-ref in libsfml-window-s.a(InputImpl.mm.o)
  "_OBJC_CLASS_$_NSImage", referenced from:
      objc-class-ref in libsfml-window-s.a(SFWindowController.mm.o)
  "_OBJC_CLASS_$_NSMenu", referenced from:
      objc-class-ref in libsfml-window-s.a(SFWindowController.mm.o)
  "_OBJC_CLASS_$_NSNotificationCenter", referenced from:
      objc-class-ref in libsfml-window-s.a(SFOpenGLView.mm.o)
  "_OBJC_CLASS_$_NSObject", referenced from:
      _OBJC_CLASS_$_SFViewController in libsfml-window-s.a(SFViewController.mm.o)
  "_OBJC_CLASS_$_NSOpenGLContext", referenced from:
      objc-class-ref in libsfml-window-s.a(SFContext.mm.o)
  "_OBJC_CLASS_$_NSOpenGLPixelFormat", referenced from:
      objc-class-ref in libsfml-window-s.a(SFContext.mm.o)
  "_OBJC_CLASS_$_NSOpenGLView", referenced from:
      _OBJC_CLASS_$_SFOpenGLView in libsfml-window-s.a(SFOpenGLView.mm.o)
      objc-class-ref in libsfml-window-s.a(SFContext.mm.o)
  "_OBJC_CLASS_$_NSResponder", referenced from:
      _OBJC_CLASS_$_SFSilentResponder in libsfml-window-s.a(SFSilentResponder.m.o)
      _OBJC_CLASS_$_SFWindowController in libsfml-window-s.a(SFWindowController.mm.o)
  "_OBJC_CLASS_$_NSString", referenced from:
      objc-class-ref in libsfml-window-s.a(cpp_objc_conversion.mm.o)
  "_OBJC_CLASS_$_NSTextView", referenced from:
      objc-class-ref in libsfml-window-s.a(SFOpenGLView.mm.o)
  "_OBJC_CLASS_$_NSThread", referenced from:
      objc-class-ref in libsfml-window-s.a(SFViewController.mm.o)
      objc-class-ref in libsfml-window-s.a(SFWindowController.mm.o)
  "_OBJC_CLASS_$_NSTrackingArea", referenced from:
      objc-class-ref in libsfml-window-s.a(SFOpenGLView.mm.o)
  "_OBJC_CLASS_$_NSView", referenced from:
      objc-class-ref in libsfml-window-s.a(InputImpl.mm.o)
      objc-class-ref in libsfml-window-s.a(WindowImplCocoa.mm.o)
  "_OBJC_CLASS_$_NSWindow", referenced from:
      objc-class-ref in libsfml-window-s.a(InputImpl.mm.o)
      objc-class-ref in libsfml-window-s.a(WindowImplCocoa.mm.o)
      objc-class-ref in libsfml-window-s.a(SFContext.mm.o)
      _OBJC_CLASS_$_SFWindow in libsfml-window-s.a(SFWindow.m.o)
  "_OBJC_METACLASS_$_NSApplication", referenced from:
      _OBJC_METACLASS_$_SFApplication in libsfml-window-s.a(SFApplication.m.o)
  "_OBJC_METACLASS_$_NSObject", referenced from:
      _OBJC_METACLASS_$_SFOpenGLView in libsfml-window-s.a(SFOpenGLView.mm.o)
      _OBJC_METACLASS_$_SFApplication in libsfml-window-s.a(SFApplication.m.o)
      _OBJC_METACLASS_$_SFSilentResponder in libsfml-window-s.a(SFSilentResponder.m.o)
      _OBJC_METACLASS_$_SFViewController in libsfml-window-s.a(SFViewController.mm.o)
      _OBJC_METACLASS_$_SFWindowController in libsfml-window-s.a(SFWindowController.mm.o)
      _OBJC_METACLASS_$_SFWindow in libsfml-window-s.a(SFWindow.m.o)
  "_OBJC_METACLASS_$_NSOpenGLView", referenced from:
      _OBJC_METACLASS_$_SFOpenGLView in libsfml-window-s.a(SFOpenGLView.mm.o)
  "_OBJC_METACLASS_$_NSResponder", referenced from:
      _OBJC_METACLASS_$_SFSilentResponder in libsfml-window-s.a(SFSilentResponder.m.o)
      _OBJC_METACLASS_$_SFWindowController in libsfml-window-s.a(SFWindowController.mm.o)
  "_OBJC_METACLASS_$_NSWindow", referenced from:
      _OBJC_METACLASS_$_SFWindow in libsfml-window-s.a(SFWindow.m.o)
  "_SetFrontProcess", referenced from:
      sf::priv::WindowImplCocoa::WindowImplCocoa(sf::VideoMode, sf::String const&, unsigned long, sf::ContextSettings const&) in libsfml-window-s.a(WindowImplCocoa.mm.o)
      sf::priv::WindowImplCocoa::WindowImplCocoa(sf::VideoMode, sf::String const&, unsigned long, sf::ContextSettings const&) in libsfml-window-s.a(WindowImplCocoa.mm.o)
      sf::priv::WindowImplCocoa::setUpProcess() in libsfml-window-s.a(WindowImplCocoa.mm.o)
  "_TISCopyCurrentKeyboardLayoutInputSource", referenced from:
      sf::priv::HIDInputManager::HIDInputManager() in libsfml-window-s.a(HIDInputManager.mm.o)
  "_TISGetInputSourceProperty", referenced from:
      sf::priv::HIDInputManager::HIDInputManager() in libsfml-window-s.a(HIDInputManager.mm.o)
  "_TransformProcessType", referenced from:
      sf::priv::WindowImplCocoa::WindowImplCocoa(sf::VideoMode, sf::String const&, unsigned long, sf::ContextSettings const&) in libsfml-window-s.a(WindowImplCocoa.mm.o)
      sf::priv::WindowImplCocoa::WindowImplCocoa(sf::VideoMode, sf::String const&, unsigned long, sf::ContextSettings const&) in libsfml-window-s.a(WindowImplCocoa.mm.o)
      sf::priv::WindowImplCocoa::setUpProcess() in libsfml-window-s.a(WindowImplCocoa.mm.o)
  "_UCKeyTranslate", referenced from:
      sf::priv::HIDInputManager::loadKey(__IOHIDElement*) in libsfml-window-s.a(HIDInputManager.mm.o)
  "___CFConstantStringClassReference", referenced from:
      CFString in libsfml-window-s.a(SFOpenGLView.mm.o)
      CFString in libsfml-window-s.a(HIDInputManager.mm.o)
      CFString in libsfml-window-s.a(HIDInputManager.mm.o)
      CFString in libsfml-window-s.a(HIDInputManager.mm.o)
      CFString in libsfml-window-s.a(cg_sf_conversion.cpp.o)
      CFString in libsfml-window-s.a(cg_sf_conversion.cpp.o)
      CFString in libsfml-window-s.a(cg_sf_conversion.cpp.o)
      ...
  "__objc_empty_cache", referenced from:
      _OBJC_CLASS_$_SFOpenGLView in libsfml-window-s.a(SFOpenGLView.mm.o)
      _OBJC_METACLASS_$_SFOpenGLView in libsfml-window-s.a(SFOpenGLView.mm.o)
      _OBJC_CLASS_$_SFApplication in libsfml-window-s.a(SFApplication.m.o)
      _OBJC_METACLASS_$_SFApplication in libsfml-window-s.a(SFApplication.m.o)
      _OBJC_METACLASS_$_SFSilentResponder in libsfml-window-s.a(SFSilentResponder.m.o)
      _OBJC_CLASS_$_SFSilentResponder in libsfml-window-s.a(SFSilentResponder.m.o)
      _OBJC_CLASS_$_SFViewController in libsfml-window-s.a(SFViewController.mm.o)
      ...
  "__objc_empty_vtable", referenced from:
      _OBJC_CLASS_$_SFOpenGLView in libsfml-window-s.a(SFOpenGLView.mm.o)
      _OBJC_METACLASS_$_SFOpenGLView in libsfml-window-s.a(SFOpenGLView.mm.o)
      _OBJC_CLASS_$_SFApplication in libsfml-window-s.a(SFApplication.m.o)
      _OBJC_METACLASS_$_SFApplication in libsfml-window-s.a(SFApplication.m.o)
      _OBJC_METACLASS_$_SFSilentResponder in libsfml-window-s.a(SFSilentResponder.m.o)
      _OBJC_CLASS_$_SFSilentResponder in libsfml-window-s.a(SFSilentResponder.m.o)
      _OBJC_CLASS_$_SFViewController in libsfml-window-s.a(SFViewController.mm.o)
      ...
  "_glEnable", referenced from:
      sf::priv::GlContext::globalInit() in libsfml-window-s.a(GlContext.cpp.o)
      sf::priv::GlContext::initialize() in libsfml-window-s.a(GlContext.cpp.o)
      (anonymous namespace)::getInternalContext() in libsfml-window-s.a(GlContext.cpp.o)
      sf::priv::GlContext::create() in libsfml-window-s.a(GlContext.cpp.o)
      sf::priv::GlContext::create(sf::ContextSettings const&, sf::priv::WindowImpl const*, unsigned int) in libsfml-window-s.a(GlContext.cpp.o)
      sf::priv::GlContext::create(sf::ContextSettings const&, unsigned int, unsigned int) in libsfml-window-s.a(GlContext.cpp.o)
  "_glGetString", referenced from:
      sf::priv::GlContext::globalInit() in libsfml-window-s.a(GlContext.cpp.o)
      sf::priv::GlContext::initialize() in libsfml-window-s.a(GlContext.cpp.o)
      (anonymous namespace)::getInternalContext() in libsfml-window-s.a(GlContext.cpp.o)
      sf::priv::GlContext::create() in libsfml-window-s.a(GlContext.cpp.o)
      sf::priv::GlContext::create(sf::ContextSettings const&, sf::priv::WindowImpl const*, unsigned int) in libsfml-window-s.a(GlContext.cpp.o)
      sf::priv::GlContext::create(sf::ContextSettings const&, unsigned int, unsigned int) in libsfml-window-s.a(GlContext.cpp.o)
  "_kCFAllocatorDefault", referenced from:
      sf::priv::HIDInputManager::copyDevicesMask(unsigned int, unsigned int) in libsfml-window-s.a(HIDInputManager.mm.o)
      sf::priv::HIDInputManager::HIDInputManager() in libsfml-window-s.a(HIDInputManager.mm.o)
      sf::priv::HIDInputManager::copyDevices(unsigned int, unsigned int) in libsfml-window-s.a(HIDInputManager.mm.o)
      sf::priv::HIDJoystickManager::HIDJoystickManager() in libsfml-window-s.a(HIDJoystickManager.cpp.o)
  "_kCFTypeDictionaryKeyCallBacks", referenced from:
      sf::priv::HIDInputManager::copyDevicesMask(unsigned int, unsigned int) in libsfml-window-s.a(HIDInputManager.mm.o)
      sf::priv::HIDInputManager::copyDevices(unsigned int, unsigned int) in libsfml-window-s.a(HIDInputManager.mm.o)
  "_kCFTypeDictionaryValueCallBacks", referenced from:
      sf::priv::HIDInputManager::copyDevicesMask(unsigned int, unsigned int) in libsfml-window-s.a(HIDInputManager.mm.o)
      sf::priv::HIDInputManager::copyDevices(unsigned int, unsigned int) in libsfml-window-s.a(HIDInputManager.mm.o)
  "_kTISPropertyUnicodeKeyLayoutData", referenced from:
      sf::priv::HIDInputManager::HIDInputManager() in libsfml-window-s.a(HIDInputManager.mm.o)
  "_objc_enumerationMutation", referenced from:
      sf::priv::getSFOpenGLViewFromSFMLWindow(sf::Window const&) in libsfml-window-s.a(InputImpl.mm.o)
  "_objc_msgSend", referenced from:
      sf::priv::getSFOpenGLViewFromSFMLWindow(sf::Window const&) in libsfml-window-s.a(InputImpl.mm.o)
      sf::priv::InputImpl::getMousePosition() in libsfml-window-s.a(InputImpl.mm.o)
      sf::priv::InputImpl::getMousePosition(sf::Window const&) in libsfml-window-s.a(InputImpl.mm.o)
      sf::priv::InputImpl::setMousePosition(sf::Vector2<int> const&, sf::Window const&) in libsfml-window-s.a(InputImpl.mm.o)
      -[SFOpenGLView initWithFrame:] in libsfml-window-s.a(SFOpenGLView.mm.o)
      -[SFOpenGLView enterFullscreen] in libsfml-window-s.a(SFOpenGLView.mm.o)
      -[SFOpenGLView exitFullscreen] in libsfml-window-s.a(SFOpenGLView.mm.o)
      ...
  "_objc_msgSendSuper2", referenced from:
      -[SFOpenGLView initWithFrame:] in libsfml-window-s.a(SFOpenGLView.mm.o)
      -[SFOpenGLView dealloc] in libsfml-window-s.a(SFOpenGLView.mm.o)
      -[SFApplication sendEvent:] in libsfml-window-s.a(SFApplication.m.o)
      -[SFViewController initWithView:] in libsfml-window-s.a(SFViewController.mm.o)
      -[SFViewController dealloc] in libsfml-window-s.a(SFViewController.mm.o)
      -[SFWindowController initWithWindow:] in libsfml-window-s.a(SFWindowController.mm.o)
      -[SFWindowController initWithMode:andStyle:] in libsfml-window-s.a(SFWindowController.mm.o)
      ...
  "_objc_msgSend_fixup", referenced from:
      l_objc_msgSend_fixup_class in libsfml-window-s.a(InputImpl.mm.o)
      l_objc_msgSend_fixup_isKindOfClass_ in libsfml-window-s.a(InputImpl.mm.o)
      l_objc_msgSend_fixup_alloc in libsfml-window-s.a(SFOpenGLView.mm.o)
      l_objc_msgSend_fixup_release in libsfml-window-s.a(SFOpenGLView.mm.o)
      l_objc_msgSend_fixup_length in libsfml-window-s.a(SFOpenGLView.mm.o)
      l_objc_msgSend_fixup_class in libsfml-window-s.a(WindowImplCocoa.mm.o)
      l_objc_msgSend_fixup_isKindOfClass_ in libsfml-window-s.a(WindowImplCocoa.mm.o)
      ...
  "_objc_msgSend_stret", referenced from:
      -[SFOpenGLView initWithFrame:] in libsfml-window-s.a(SFOpenGLView.mm.o)
      -[SFOpenGLView computeGlobalPositionOfRelativePoint:] in libsfml-window-s.a(SFOpenGLView.mm.o)
      -[SFOpenGLView frameDidChange:] in libsfml-window-s.a(SFOpenGLView.mm.o)
      -[SFOpenGLView isMouseInside] in libsfml-window-s.a(SFOpenGLView.mm.o)
      -[SFOpenGLView cursorPositionFromEvent:] in libsfml-window-s.a(SFOpenGLView.mm.o)
      -[SFViewController initWithView:] in libsfml-window-s.a(SFViewController.mm.o)
      -[SFViewController size] in libsfml-window-s.a(SFViewController.mm.o)
      ...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [lib/libdsfml-window.2.0.dylib] Error 1
make[1]: *** [src/SFML/Window/CMakeFiles/dsfml-window.dir/all] Error 2
make: *** [all] Error 2

Any help would be had [=

"X Error of failed request" on Linux

hello_dsfml.d:

import dsfml.graphics;

void main()
{
    auto vmode = VideoMode( 640, 480 );
    string title = "hello world!";

    auto screen = new RenderWindow( vmode, title );
}

compiling and run:

$ dmd -I/usr/include/dmd/ -I./DSFML/ -L-ldl -L-lcsfml-graphics -L-lcsfml-window -L-lcsfml-system -g -debug -ofhello DSFML/dsfml/window.d DSFML/dsfml/graphics.d DSFML/dsfml/system.d hello_dsfml.d

$ ./hello
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 1 (X_CreateWindow)
Value in failed request: 0x0
Serial number of failed request: 94
Current serial number in output stream: 95

Code Separation

The code should really be split into separate files. While this makes things a little tricky with how the binding is(specifically trying to hide the C parts while sharing the implementation between files), but I think it would not only increase readability, but also helps make things easier when working on the codebase overall.

Side note:

I have already started this project and am about 50% done.

DSFML Temporary Hiatus starting in December

Greetings DSFML users!

I just wanted to announce that starting December 1st DSFML will be in a temporary hiatus. I will be focusing on the SFML Game Jam to make sure there is plenty of time to make it a really really great event. I will do my best to get as much done on the library before then, however. Any major bugs will still get attention from me, but new features/improvements will not be worked on unless I feel like the jam is taken care of and I have extra time.

Regular development will resume next year after the jam is either finished or set up completely!

Remove Internal.h

The purpose of this file is to perform any validity checks of the sfXXX pointer types in a debug run, but I think this should be moved into the D part of the binding. This should make it easier to catch any errors in the D code.

Rewrite SFML's SoundFile class in D

To completely remove the CMake dependency of sndfile and make teh C building more simplified, I want to rewrite SFML's SoundFile class in D.

Fix library names!

This is a little embarrassing, but I blame Windows for this more than anything else.

Currently, the naming for the shared libraries on both Linux and OSX conflict with the names of the static libraries, eg there exists both libdsfml-xxx.a and libdsfml-xxx.so/dylib, which was probably causing confusion for both the users and the linkers. For consistency, it should have been a problem on Windows as well, but my own ignorance for what library files should be named prevented that so far. I know that I have Linux users out there, so I'm surprised no one has said anything so far(COUGH, @aubade, COUGH).

Here's what needs to happen:

The import libraries for Windows should be named dsfml-xxx.lib

The D static libraries need to have new names. Not sure what to call them though. I'm considering libdsfml-xxx-s.a/dsfml-xxx-s.lib, but I don't want to give people the impression that dsfml can be built purely statically. I'm also considering tacking on the version number; libdsfml-xxx-2.a/dsfml-xxx-2.lib, or maybe libdsfml-xxx-2.0.a/dsfml-xxx-2.0.lib. I'm also up for suggestions.

I'd like to fix this as soon as I can so that I can get things consistent and clean, as well as get the tutorial updated and the DUB package.json finished and working for each OS. I'll do some research tomorrow and try to figure out what to call the damn things, but I want to make a decision as soon as possible.

OpenGL Derelict3

I want to know how to get Derelict 3 paired with dsfml. Whats the best way to go about setting that up? I am probably not the only one wanting to find out how to do that as well... so it should be answered.

Currently I got it to compile with dsfml but my problem seems to be a issue with OpenGL context and I am kinda clueless on where to start first.

I do know how to draw OpenGL with SFML but with dsfml... Kinda clueless.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.