Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Window wont pop up when compiling program  (Read 2063 times)

0 Members and 1 Guest are viewing this topic.

sssupply

  • Newbie
  • *
  • Posts: 3
    • View Profile
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.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Window wont pop up when compiling program
« Reply #1 on: November 10, 2011, 04:17:17 pm »
ATI graphics card?
Laurent Gomila - SFML developer

sssupply

  • Newbie
  • *
  • Posts: 3
    • View Profile
Window wont pop up when compiling program
« Reply #2 on: November 10, 2011, 04:21:02 pm »
Yeah I use an amd radeon 6490. I never knew that would have an effect on this.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Window wont pop up when compiling program
« Reply #3 on: November 10, 2011, 04:44:32 pm »
It's a known bug. The forum is full of threads about this.
Laurent Gomila - SFML developer

sssupply

  • Newbie
  • *
  • Posts: 3
    • View Profile
Window wont pop up when compiling program
« Reply #4 on: November 10, 2011, 06:58:45 pm »
Okay so I realize that I need to statically link SFML, but I'm basically lost when it comes to doing this. If anyone can give me some tips on how to do this it would be greatly apprecitated.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Window wont pop up when compiling program
« Reply #5 on: November 11, 2011, 10:38:20 am »
It's explained in the tutorials.
Laurent Gomila - SFML developer