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

Pages: [1]
1
Graphics / Re: unable to open file , read details please.[Linux]
« on: July 01, 2016, 04:01:36 pm »
Fixed. I had to change .jpg to .JPG in my code. Thanks for the help eXpli0it3r.

2
Graphics / Re: unable to open file , read details please.[Linux]
« on: July 01, 2016, 10:21:45 am »
Yes the texture exists at that specific location .  I don't know what read access means in this context .

3
Graphics / unable to open file , read details please.[Linux]
« on: June 29, 2016, 12:12:42 pm »
This is my code for drawing a circle with a texture loaded from file .
#include<SFML/Graphics.hpp>
#include<SFML/Window.hpp>

int main()
{
        sf::ContextSettings settings ;
        settings.antialiasingLevel = 8 ;
        sf::RenderWindow window(sf::VideoMode(800,600) , "Shapes"  , sf::Style::Default , settings) ;
        sf::CircleShape circle ;
        circle.setRadius(80) ;
        circle.setPointCount(200) ;
        sf::Texture texture ;
        texture.loadFromFile("/home/deepukps/Downloads/texture.jpg") ;
        circle.setTexture(&texture) ;
       
        while (window.isOpen())
        {
                sf::Event event ;
                while (window.pollEvent(event))
                {
                        if (event.type == sf::Event::Closed)
                                window.close() ;
                }
                window.clear() ;
                window.draw(circle) ;
                window.display() ;
        }
       
        return 0 ;
}
 

And this is how I linked the linked the libraries after compiling my code -
g++ shape.o -o sfml-app -lsfml-graphics -lsfml-window -lsfml-system

This is the error message I get - Failed to load image "/home/deepukps/Downloads/texture.jpg". Reason: Unable to open file
What exactly am I doing wrong?

Pages: [1]