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

Pages: [1]
1
General / Image not loading.
« on: February 06, 2016, 07:34:25 pm »
Can someone help me with this code, i dont know why it isnt showing the image, i just get a black screen.
It seems like a .dll issue but im not sure.
Thx. ;D

#include <SFML/Graphics.hpp>

int main()
{
        sf::RenderWindow window(sf::VideoMode(640, 360), "Space invaders");
        sf::Texture backgroundTexture;
        backgroundTexture.loadFromFile("original.jpg");
        sf::Sprite backgroundSprite;
        backgroundSprite.setTexture(backgroundTexture);

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

                window.clear();
                window.draw(backgroundSprite);
                window.display();

        }

        return 0;
}

Pages: [1]
anything