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

Pages: [1]
1
Graphics / App crashes if more than 1 sprite used
« on: August 19, 2009, 01:07:04 pm »
Okay, just tested something. If I create the images on the heap memory, it works fine:

Code: [Select]
Image *i_one = new Image;
    if( !(*i_one).LoadFromFile("test.png") )
        return EXIT_FAILURE;
    Sprite s_one(*i_one);

    Image *i_two = new Image;
    if( !(*i_two).LoadFromFile("test.png") )
        return EXIT_FAILURE;
    Sprite s_two(*i_two);


Now I am totally confused x_x

2
Graphics / App crashes if more than 1 sprite used
« on: August 19, 2009, 12:58:54 pm »
It happens all in debug mode (yes, I've linked to the proper libs).

SetImage() causes the same effect.

I use SFML 1.5 under WinXP Prof SP3.


Interestingly enough, this doesn't seem to happen if s_two gets its image from i_one Oo Don't understand why...

3
Graphics / App crashes if more than 1 sprite used
« on: August 19, 2009, 03:49:13 am »
I just broke down the code to its absolute minimum. Even if I have an event loop this message occurs. If I quit my application while only one sprite is being used, the application returns the value 0x0, everything fine. If I use more than one sprite, it returns 0xC0000005 on closure.

4
Graphics / App crashes if more than 1 sprite used
« on: August 19, 2009, 03:13:47 am »
Hey guys.

I have no idea what's going wrong here. This is the problem:

Code: [Select]
#include <SFML/Graphics.hpp>

using namespace sf;

int main()
{
    RenderWindow App(VideoMode(800,600,32), "Test", Style::Titlebar);
    App.Clear(Color(255,255,255));

    Image i_one;
    if( !i_one.LoadFromFile("test.png") )
        return EXIT_FAILURE;
    Sprite s_one(i_one);

    Image i_two;
    if( !i_two.LoadFromFile("test.png") )
        return EXIT_FAILURE;
    Sprite s_two(i_two);

    App.Draw(s_one);
    App.Draw(s_two);
    App.Display();
    Sleep(1.0f);
    App.Close();

    return EXIT_SUCCESS;
}


This code causes my application to crash. If I only declare one sprite, everything works fine. But from the moment I use two or more sprites the application crashes and it can't be helped. The message I receive is as follows:

Quote
Process returned -1073741819 (0xC0000005)


I get the same message each time.

Any ideas? I'm desperated :(

Pages: [1]