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

Pages: [1]
1
General / Re: Reason: Unable to open file
« on: July 05, 2021, 07:55:29 am »
I don't know if the working directory is the issue because I've tried the full location of the file too and it gave the same error, and I am sure that's the file's
    sf::RenderWindow window(sf::VideoMode(800, 800), "Chess"); //calls a window
    window.setVerticalSyncEnabled(true);
    sf::Texture t1;
    t1.loadFromFile("C:/Users/jagdr/Downloads/Code/SFML Chess/Debug/Images/board.jpg");
    sf::Sprite board(t1);
 
name.

But if that is the issue how can I change the working directory?


2
General / Reason: Unable to open file
« on: July 04, 2021, 05:53:47 am »
I keep getting this error when I try to use "IncludeFromFile" for a sprite texture. I've tried to change the directory from shortened to full and change the picture just in case but it doesn't load the image.

I feel it is a mistake on my end like a mistake in calling the file or linking as I'm relatively new to both sfml and C++.

I'm using Visual studio 2019, and running a debug

   
int main()
{
    sf::RenderWindow window(sf::VideoMode(800, 800), "Game"); //calls a window
    window.setVerticalSyncEnabled(true);
    sf::Texture t1;
    t1.loadFromFile("Images/whitePawn.png");
    sf::Sprite board(t1);

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

        window.clear(); //set black
        window.draw(board); //draw whats needed
        window.display(); //reset for new frame

    }
 

I hope someone can help  :D, Thanks in advance

Pages: [1]
anything