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

Pages: [1]
1
D / Re: Access Violation?
« on: October 20, 2016, 06:10:20 pm »
I put a bunch of writeln calls in renderwindow.d and sprite.d to see where it crashes. It turns out window.draw(sprite) calls sprite.draw(window, states) which in turn calls the overload of window.draw that takes an array of vertices, a primitive type and render states. The code then crashes after the sfRenderWindow_drawPrimitives call. sfRenderWindow_drawPrimitives is an extern(C) function so that leads me to believe the issue is in the dfmlc-graphics.lib file. I built DSFML 2.1.1 using dub but it didn't include the dsfmlc-*.lib files, so I downloaded those from here : http://dsfml.com/downloads.html

You think those could be outdated ?

Here's the output of the writeln calls :

Code: [Select]
renderwindow.d:517 : dsfml.graphics.sprite.Sprite.draw(dsfml.graphics.renderwindow.RenderWindow, RenderStates(Alpha, , Rebindable!(const(Texture))(#{overlap original, stripped}), Rebindable!(const(Shader))(#{overlap original, stripped})));

sprite.d:200: draw(dsfml.graphics.renderwindow.RenderWindow, RenderStates(Alpha, Rebindable!(const(Texture))(#{overlap original, stripped}), Rebindable!(const(Shader))(#{overlap original, stripped})));

sprite.d:206 dsfml.graphics.renderwindow.RenderWindow.draw([Vertex(X: 0 Y: 0, R: 255 G: 255 B: 255 A: 255, X: 0 Y: 0), Vertex(X: 0 Y: 145, R: 255 G: 255 B: 255 A: 255, X: 0 Y: 145), Vertex(X: 277 Y: 145, R: 255 G: 255 B: 255 A: 255, X: 277 Y: 145), Vertex(X: 277 Y: 0, R: 255 G: 255 B: 255 A: 255, X: 277 Y: 0)], Quads, RenderStates(Alpha, , Rebindable!(const(Texture))(#{overlap original, stripped}), Rebindable!(const(Shader))(#{overlap original, stripped})));

renderwindow.d:533 draw([const(Vertex)(X: 0 Y: 0, R: 255 G: 255 B: 255 A: 255, X: 0 Y: 0), const(Vertex)(X: 0 Y: 145, R: 255 G: 255 B: 255 A: 255, X: 0 Y: 145), const(Vertex)(X: 277 Y: 145, R: 255 G: 255 B: 255 A: 255, X: 277 Y: 145), const(Vertex)(X: 277 Y: 0, R: 255 G: 255 B: 255 A: 255, X: 277 Y: 0)], Quads, RenderStates(Alpha, , Rebindable!(const(Texture))(#{overlap original, stripped}), Rebindable!(const(Shader))(#{overlap original, stripped})));

renderwindow.d:546 : sfRenderWindow_drawPrimitives(7CC9C8, 19D307C, 4, Quads, Alpha, 12FC90, 7CC608, 7CC988);


object.Error@(0): Access Violation
----------------

2
D / Re: Access Violation?
« on: October 20, 2016, 02:29:01 am »
I ran into a similar problem on Windows 7 32 bits with dmd v2.071.2 and "dsfml": "~>2.1.1".

I narrowed the issue down to the window.draw call :

int main(string[] args)
{
        auto window = new RenderWindow(VideoMode(640, 480), "Cave");
        auto brick = new Texture();
        if(!brick.loadFromFile("img\\brick_texture.png"))
                return 1; //nope
        auto sprite = new Sprite(brick);
        writeln(sprite is null); //false
        writeln(brick is null); //false
        while(window.isOpen)
        {
                Event evt;
                while(window.pollEvent(evt))
                {
                        window.clear(Color.Black);
                        window.draw(sprite); //Access violation
                        window.display();
                        if(evt.type == evt.EventType.Closed || Keyboard.isKeyPressed(Keyboard.Key.Escape))
                        {
                                window.close();
                        }
                }
        }
        return 0;
}
 

Pages: [1]
anything