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

Pages: [1]
1
Graphics / Re: Unable to open file
« on: January 06, 2018, 12:52:50 am »
The thing is that the sample code works perfectly
Could there still be a problem with the linker with that in mind?

2
Graphics / Re: Unable to open file
« on: January 05, 2018, 08:26:17 pm »
I'm using Visual Studio 2017

Well ive done everything with the properties as it's shown in the book
The linker is okay i think

How could i change my start to the path?
What should i do?

3
Graphics / Unable to open file
« on: January 05, 2018, 01:56:06 am »
Hey everyone,

I'm new to SFML, and just bought that book about game programming with SFML,
but i have some problems.

Here is the code:

#include <SFML/Graphics.hpp>
using namespace sf;
int main()
{

        VideoMode vm(1920, 1080);

        RenderWindow window(vm, "Timber", Style::Fullscreen);

        Texture textureBackground;

        textureBackground.loadFromFile("assets/graphics/background.png");

        Sprite spriteBackground;

        spriteBackground.setTexture(textureBackground);

        spriteBackground.setPosition(0, 0);


        while (window.isOpen())
        {

                if (Keyboard::isKeyPressed(Keyboard::Escape))
                {
                        window.close();
                }

                window.clear();

                window.draw(spriteBackground);

                window.display();

        }

        return 0;
}


 


The thing is that i cant load the background.
This is the message i get: "The requested video mode is not available, switching to a valid mode
w╠їя          8     ". Reason: Unable to open file"

Where am i wrong?

And just to note, i've tried moving the png file everywhere and still no success

Pages: [1]