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

Pages: [1]
1
General / Re: Texture "loadFromFile" does not work
« on: April 09, 2019, 06:20:55 pm »
Thank you very much!
That fixed it.

2
General / Texture "loadFromFile" does not work
« on: April 09, 2019, 05:41:32 pm »
Hello, I've been trying to get an example to work.
This is the code I currently have:

#include <SFML/Graphics.hpp>
#include <time.h>
using namespace sf;

int main()
{
        RenderWindow window(VideoMode(320, 480), "The Game!");

        Texture t;
        t.loadFromFile("images/tiles.png");

        while (window.isOpen())
        {
                Event e;
                while (window.pollEvent(e))
                {
                        if (e.type == Event::Closed)
                                window.close();
                }
                window.clear(Color::White);
                window.display();
        }

        return 0;
}

However, the "loadFromFile" does not work. (If I comment that line out, everything's fine)
I checked the current working directory, and it is set to the project directory.
I tried setting it to the specific folder, but it still doesn't work.
I am using Visual Studio 2017.
Sadly even the command line only gives me some garbled text, so I have no idea what is even going wrong. (See the attachment)

Pages: [1]
anything