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

Pages: [1]
1
General / Re: Can't seem to load an image from file (VS 2010)
« on: June 20, 2012, 09:13:57 am »
It seems like you're using release libraries in debug mode. Don't do that (it's written in the tutorial).

Wow i didn't even realise i was doing that and its one of the first things i checked. Doh.
Thanks for your replies, it seems to be working now - no crashes at least :)

2
General / Re: Can't seem to load an image from file (VS 2010)
« on: June 19, 2012, 10:58:49 pm »
Which SFML package did you download? Are you sure that you don't have another version? Have you followed the tutorial?

Quote
TerminateProcess(GetCurrentProcess(), EXIT_SUCCESS);
???

The code you put ?? next to is to stop getting an error after closing the window on debugging (i found in this thread: http://en.sfml-dev.org/forums/index.php?topic=3976.msg26066#msg26066)

Also firstly i was using the release candidate for version 2 that is on the website (for vs 2010) and when i compiled i used files from github. Both of wich produced this error.

Also dude.jpg is 10kb. Tried using a png and got the same outcome.

Thanks for the responses :)

3
General / Re: Can't seem to load an image from file (VS 2010)
« on: June 19, 2012, 10:10:06 pm »
Thanks for the reply but i Just tried both of those methods and i am still getting the same thing =[

4
General / Can't seem to load an image from file (VS 2010)
« on: June 19, 2012, 08:36:47 pm »
I have bee trying to figure out why for ages now. But if i try to load a file from the disk (both for image and texture) and i just get an unhandled exception.

This is the code:

#include <SFML/Graphics.hpp>
#include <Windows.h>

int main()
{
    sf::RenderWindow window(sf::VideoMode(1024, 768), "SFML works!");

    sf::Text text("Hello SFML");
        sf::Texture texture;

        texture.loadFromFile("dude.jpg");

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

        window.clear();
        window.draw(text);
        window.display();
    }

    TerminateProcess(GetCurrentProcess(), EXIT_SUCCESS);
}
 

After some searching I thought maybe recompiling was the answer, but it didn't change a thing =(.
Also i managed to create an image giving it a colour, height and width so it leads me to think that te file is just not being found.

Here is some other relevant stuff:

Exception
Code: [Select]
Unhandled exception at 0x653a1f34 in SMFLTEST2.exe: 0xC0000005: Access violation reading location 0x00277000.

Callstack
Code: [Select]
msvcr100.dll!653a1f34()
  [Frames below may be incorrect and/or missing, no symbols loaded for msvcr100.dll]
  msvcp100.dll!644c1153()
  msvcp100.dll!644c2635()
  sfml-graphics-2.dll!510e1ca6()
  sfml-graphics-2.dll!510f1b17()
  sfml-graphics-2.dll!510e5308()
  sfml-graphics-2.dll!510fb204()
> SMFLTEST2.exe!main()  Line 11 + 0x35 bytes C++
  SMFLTEST2.exe!_WinMain@16()  + 0x16 bytes C++
  SMFLTEST2.exe!__tmainCRTStartup()  Line 547 + 0x2c bytes C
  SMFLTEST2.exe!WinMainCRTStartup()  Line 371 C
  kernel32.dll!770d3677()
  ntdll.dll!77c99d72()
  ntdll.dll!77c99d45()


Gfx card: AMD Radeon 7850 with 12.4 CCC

Pages: [1]
anything