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.


Topics - sssupply

Pages: [1]
1
Window / Window wont pop up when compiling program
« on: November 10, 2011, 04:14:46 pm »
Hey guys, I'm very new to SFML and ive been trying to just get the basics down but ive been struggling :(. I made code based on a tutorial to make a window pop up that has a little square in the middle but when i run it, no window pops up, just the command prompt.

Here is my code,

Code: [Select]
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>

int main()
{
    sf::RenderWindow Game(sf::VideoMode(800, 600, 32), "SFML Blank Window");

    sf::Event Event;

    sf::Shape box = sf::Shape::Rectangle(0, 0, 50, 50, sf::Color(127,0,0,255));

    box.SetPosition(100, 100);

    while(Game.IsOpened())
    {
        while(Game.GetEvent(Event))
        {
            if(Event.Type == sf::Event::Closed)
                Game.Close();
        }

        Game.Clear(sf::Color(100, 149, 237));

        Game.Draw(box);

        Game.Display();
    }

    return EXIT_SUCCESS;
}


Any help would be greatly appreciated.

Thanks,
Jeff.

Pages: [1]