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 - 22ndCG

Pages: [1]
1
Graphics / Re: sf::Texture Destructor Causing Segfault
« on: October 29, 2012, 11:53:00 pm »
It must be my build then. That same exact example causes the segfault for me. I'll re-download and recompile SFML. Thanks.

2
Graphics / Re: Moving sf::View smoothly
« on: October 27, 2012, 07:10:44 pm »
You could simply "slow down" the entire frame (physics, ai, rendering, everything) to accommodate for lag. That way the game will only slow down when there is lag, but not be jerky. I wouldn't be terribly concerned with it, however, as no one really expects a game to look great when its lagging.

3
Graphics / sf::Texture Destructor Causing Segfault
« on: October 27, 2012, 05:50:05 am »
I have no idea why, but if a Texture has image data loaded when its destructor is called, it causes a segfault. I'm using CodeBlocks with MinGW, and my SFML build was just updated about a month ago. No segfault occurs if the image is not loaded, however.

Some code that reproduces the crash:
#include <SFML.hpp>
using namespace sf;

int main()
{
    RenderWindow window(VideoMode(640, 480, 32), "Texture Crasher");
    Texture tx1, tx2;
    tx1.loadFromFile("image.png");
    tx2.loadFromFile("image.png");

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

        window.clear();
        window.display();

        sleep(milliseconds(25));
    }

    return 0;
}
 

GDP outputs:
#0 7763E3BE   ntdll!LdrWx86FormatVirtualImage() (C:\Windows\system32\ntdll.dll:??)
#1 00000000   0x00000000 in ??() (??:??)

Any idea on why this is happening or how I can fix it? Outside of a debugger, the program will rarely crash, but that doesn't mean everything is working ok.

Pages: [1]
anything