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

Author Topic: SFML no grapics window  (Read 2163 times)

0 Members and 1 Guest are viewing this topic.

WedranB

  • Newbie
  • *
  • Posts: 1
    • View Profile
SFML no grapics window
« on: December 24, 2011, 03:37:09 pm »
Here is my problem.When i try to run this code i only get CMD window and no SFML window(800x600)...Where is the problem?

http://imageshack.us/photo/my-images/715/21742770.png/

Code: [Select]

#include <SFML/Graphics.hpp>


int main()
{
    // Create the main rendering window
    sf::RenderWindow App(sf::VideoMode(800, 600, 32), "SFML Graphics");

    // Start game loop
    while (App.IsOpened())
    {
        // Process events
        sf::Event Event;
        while (App.GetEvent(Event))
        {
            // Close window : exit
            if (Event.Type == sf::Event::Closed)
                App.Close();

            // A key has been pressed
            if (Event.Type == sf::Event::KeyPressed)
            {
                // Escape key : exit
                if (Event.Key.Code == sf::Key::Escape)
                    App.Close();

                // F1 key : capture a screenshot
                if (Event.Key.Code == sf::Key::F1)
                {
                    sf::Image Screen = App.Capture();
                    Screen.SaveToFile("screenshot.jpg");
                }
            }
        }

        // Clear the screen with red color
        App.Clear(sf::Color(200, 0, 0));

        // Display window contents on screen
        App.Display();
    }

    return EXIT_SUCCESS;
}



Pyrius

  • Newbie
  • *
  • Posts: 39
    • View Profile
SFML no grapics window
« Reply #1 on: December 24, 2011, 04:36:23 pm »
It works just fine for me (SFML2).

c0ffee

  • Newbie
  • *
  • Posts: 13
    • View Profile
SFML no grapics window
« Reply #2 on: December 28, 2011, 03:37:34 pm »
it also works with 1.6

The DarK'

  • Sr. Member
  • ****
  • Posts: 255
    • View Profile
SFML no grapics window
« Reply #3 on: December 28, 2011, 03:47:32 pm »
Do you have an ATI graphic card ?

It could cause issue with SFML 1.6 (which is not maintened anymore). You can use 2.0.

 

anything