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 - esquinn

Pages: [1]
1
D / Extensions for DSFML
« on: May 07, 2013, 05:37:50 pm »
Hi! I've started a project to collect ports and wrappers of SFML and CSFML extensions for use with DSFML (Specifically, I'm targetting Jebbs' DSFML rather than the derelict wrappers, because i like OOP :) )

Right now, it's only got a native D port of Zorexx's sfMod and sfMidi, but given how relatively uncommon D still is, it seemed like a good idea to offer a central place to collect and maintain these.

The repository is available on: https://github.com/aubade/dsfml-contrib -- bug reports and new extensions are welcome!

2
D / Re: Candidate for new official DSFML
« on: March 26, 2013, 07:11:01 pm »
Alrighty. Did a quick best-as-possible conversion of the SFML wiki's little sample program, and I've got something that not only compiles, but runs.

Caveats: You've got a typo in your Font class--the loadFromFile () method is listed as lodFromFile.

And you don't seem to have the openFromFile methods implemented for your Audio classes

But, with that said and done, this compiled and ran on my end, with the modifications I made.

module main;

import dsfml.window;
import dsfml.audio;
import dsfml.graphics;
import dsfml.network;
import dsfml.system;

import std.stdio;

int main (string[] args)
{
        auto window = new dsfml.graphics.RenderWindow (dsfml.graphics.VideoMode (800,600), "SFML window");

        auto texture = new dsfml.graphics.Texture ();
       
        writefln ("phase!");

        if (!texture.loadFromFile("cute_image.jpg"))
                return 1;
        writefln ("phase!");

        auto sprite = new dsfml.graphics.Sprite (texture);

        writefln ("phase!");

        auto font = new dsfml.graphics.Font();
        if (!font.loadFromFile("arial.ttf"))
                return 1;

        writefln ("phase!");

        auto text = new dsfml.graphics.Text ("Hello SFML", font, 50);

        writefln ("phase!");

        auto music = new dsfml.audio.Music ("nice_music.ogg");

        writefln ("phase!");

/*      if (!music.openFromFile("nice_music.ogg"))
                return 1;*/


        music.play ();

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

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

                window.clear (dsfml.graphics.Color.Black);
                window.draw (sprite);
                window.draw (text);
                window.display ();
        }


        writefln ("Hi! I'm not a bug.");

        return 0;
}
 

3
D / Re: Candidate for new official DSFML
« on: March 26, 2013, 06:18:19 pm »
Okay, I'm not actually all that familiar with the deeper intracacies of D, and  this might be some really bad hackery and might even segfault once I start actually calling DSFML code, but...

The compiler seems to be having difficulty with the format "ref StructName argument = StructName ()"



sooooo, playing with window.d, I put this at the top of the module:

const ContextSettings DefaultContextSettings = ContextSettings ();


then changed every instance of "ref ContextSettings settings = ContextSettings ()" to "ref ContextSettings settings = DefaultContextSettings"

for DefaultRenderstates, however, I had to leave the 'const' out of the declaration up top. I hope *that* doesn't bode ill.

and it compiles.

4
D / Re: Candidate for new official DSFML
« on: March 26, 2013, 05:22:32 pm »
Here's the "project" as such--At the moment, I'm compiling entirely on the command line. I have that in my Documents\projects\dsfmltest folder, cd into it with the command prompt, and manually run "dmd test.d".

https://dl.dropbox.com/u/187059/dsfmltest.zip

If it helps, I'm running on windows 7 x64, though to the best of my knowledge, my entire build chain is 32-bit. My DMD reads version 2.062

5
D / Re: Candidate for new official DSFML
« on: March 26, 2013, 12:18:23 pm »
This might be a newbie mistake, but I'm trying to futz around with your code, but I haven't even quite gotten to the point of calling any of your functions. I've tried the latest DMD for both D1 and D2, and both of them error out with this snippet.

module main;

import dsfml.window;
import dsfml.audio;
import dsfml.graphics;
import dsfml.network;
import dsfml.system;

import std.stdio;


int main (string[] args)
{
        writefln ("Hi! I'm a bug.");
        return 0;
}
 

I'm running dmd -run test.d

d1 gives this string of errors:

dsfml\window.d(106): Error: Declaration expected, not '('
dsfml\window.d(112): Error: Declaration expected, not 'TOK216'
dsfml\window.d(117): Error: unrecognized declaration
dsfml\audio.d(26): Error: Declaration expected, not 'TOK216'
dsfml\audio.d(37): Error: unrecognized declaration
dsfml\graphics.d(65): Error: semicolon expected following function declaration
dsfml\graphics.d(67): Error: Declaration expected, not 'return'
dsfml\graphics.d(71): Error: Declaration expected, not 'TOK216'
dsfml\graphics.d(81): Error: unrecognized declaration
dsfml\network.d(130): Error: found '!' when expecting ';' following statement
dsfml\network.d(161): Error: Declaration expected, not '('
dsfml\network.d(175): Error: basic type expected, not const
dsfml\network.d(175): Error: default argument expected for int
dsfml\network.d(175): Error: found 'const' when expecting ')'
dsfml\network.d(175): Error: semicolon expected following function declaration
dsfml\network.d(175): Error: Declaration expected, not '('
dsfml\network.d(178): Error: no identifier for declarator Message
dsfml\network.d(178): Error: semicolon expected to close declaration, not '!'
dsfml\network.d(178): Error: Declaration expected, not '!'
dsfml\network.d(251): Error: unrecognized declaration
dsfml\system.d(44): Error: semicolon expected following function declaration
 


Compiling with D2, on the other hand, gets me this:

dsfml\window.d(70): Error: ContextSettings(0u, 0u, 0u, 2u, 0u) is not an lvalue
dsfml\window.d(76): Error: ContextSettings(0u, 0u, 0u, 2u, 0u) is not an lvalue
dsfml\graphics.d(1006): Error: RenderStates(cast(BlendMode)0, Transform(sfTransform([1F, 0F, 0F, 0F, 1F, 0F, 0F, 0F, 1F])), null, null, sfRenderStates(cast(BlendMode)0, sfTransform([nanF, nanF, nanF, nanF, nanF, nanF, nanF, nanF, nanF]), null, null)) is not an lvalue
dsfml\graphics.d(1008): Error: RenderStates(cast(BlendMode)0, Transform(sfTransform([1F, 0F, 0F, 0F, 1F, 0F, 0F, 0F, 1F])), null, null, sfRenderStates(cast(BlendMode)0, sfTransform([nanF, nanF, nanF, nanF, nanF, nanF, nanF, nanF, nanF]), null, null)) is not an lvalue
dsfml\graphics.d(1101): Error: RenderStates(cast(BlendMode)0, Transform(sfTransform([1F, 0F, 0F, 0F, 1F, 0F, 0F, 0F, 1F])), null, null, sfRenderStates(cast(BlendMode)0, sfTransform([nanF, nanF, nanF, nanF, nanF, nanF, nanF, nanF, nanF]), null, null)) is not an lvalue
dsfml\graphics.d(1100): Deprecation: overriding base class function without using override attribute is deprecated (dsfml.graphics.RenderTexture.draw overrides dsfml.graphics.RenderTarget.draw)
dsfml\graphics.d(1107): Error: RenderStates(cast(BlendMode)0, Transform(sfTransform([1F, 0F, 0F, 0F, 1F, 0F, 0F, 0F, 1F])), null, null, sfRenderStates(cast(BlendMode)0, sfTransform([nanF, nanF, nanF, nanF, nanF, nanF, nanF, nanF, nanF]), null, null)) is not an lvalue
dsfml\graphics.d(1106): Deprecation: overriding base class function without using override attribute is deprecated (dsfml.graphics.RenderTexture.draw overrides dsfml.graphics.RenderTarget.draw)
dsfml\graphics.d(1136): Error: ContextSettings(0u, 0u, 0u, 2u, 0u) is not an lvalue
dsfml\graphics.d(1142): Error: ContextSettings(0u, 0u, 0u, 2u, 0u) is not an lvalue
dsfml\graphics.d(1238): Error: RenderStates(cast(BlendMode)0, Transform(sfTransform([1F, 0F, 0F, 0F, 1F, 0F, 0F, 0F, 1F])), null, null, sfRenderStates(cast(BlendMode)0, sfTransform([nanF, nanF, nanF, nanF, nanF, nanF, nanF, nanF, nanF]), null, null)) is not an lvalue
dsfml\graphics.d(1237): Deprecation: overriding base class function without using override attribute is deprecated (dsfml.graphics.RenderWindow.draw overrides dsfml.graphics.RenderTarget.draw)
dsfml\graphics.d(1243): Error: RenderStates(cast(BlendMode)0, Transform(sfTransform([1F, 0F, 0F, 0F, 1F, 0F, 0F, 0F, 1F])), null, null, sfRenderStates(cast(BlendMode)0, sfTransform([nanF, nanF, nanF, nanF, nanF, nanF, nanF, nanF, nanF]), null, null)) is not an lvalue
dsfml\graphics.d(1242): Deprecation: overriding base class function without using override attribute is deprecated (dsfml.graphics.RenderWindow.draw overrides dsfml.graphics.RenderTarget.draw)
 


Pages: [1]