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

Author Topic: no windows pops up  (Read 1230 times)

0 Members and 1 Guest are viewing this topic.

metulburr

  • Newbie
  • *
  • Posts: 49
    • View Profile
    • Email
no windows pops up
« on: October 08, 2013, 05:33:16 am »
I am not sure why a SFML windows does not appear when compiled and executed. I am on ubuntu, downloaded sfml from ubuntu repos. I am assuming ubuntu has the oldest version 1.6, but i am not sure on how to tell. I dont get any error messages when compiling, but no window appears.

I am compiling it via:
g++ -Wall -o "%e" "%f" -lsfml-audio -lsfml-graphics -lsfml-window -lsfml-system
under geany's IDE

#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();
        }

        // Clear the screen (fill it with black color)
        App.Clear();

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

    return EXIT_SUCCESS;
}
 
OS Ubuntu 13.04, Arch Linux, Gentoo, Windows 7/8
SFML 2.1
Ati Radeon HD 6770

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: no windows pops up
« Reply #1 on: October 08, 2013, 05:44:44 am »
http://en.sfml-dev.org/forums/index.php?topic=11338.0

Install according to that, before you start working with SFML for real, and have fun.
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

metulburr

  • Newbie
  • *
  • Posts: 49
    • View Profile
    • Email
Re: no windows pops up
« Reply #2 on: October 08, 2013, 05:52:58 am »
now after doing that process, i get compile errors:
test.cpp: In function ‘int main():
test.cpp:10:16: error:class sf::RenderWindow’ has no member named ‘IsOpened’
     while (App.IsOpened())
                ^
test.cpp:14:20: error:class sf::RenderWindow’ has no member named ‘GetEvent’
         while (App.GetEvent(Event))
                    ^
test.cpp:17:23: error:class sf::Event’ has no member named ‘Type’
             if (Event.Type == sf::Event::Closed)
                       ^
test.cpp:18:21: error:class sf::RenderWindow’ has no member named ‘Close’
                 App.Close();
                     ^
test.cpp:22:13: error:class sf::RenderWindow’ has no member named ‘Clear’
         App.Clear();
             ^
test.cpp:25:13: error:class sf::RenderWindow’ has no member named ‘Display’
         App.Display();
             ^
 
I changed it also from IsOpened to IsOpen as the docs say, but i get the same erros
« Last Edit: October 08, 2013, 06:07:09 am by metulburr »
OS Ubuntu 13.04, Arch Linux, Gentoo, Windows 7/8
SFML 2.1
Ati Radeon HD 6770

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: no windows pops up
« Reply #3 on: October 08, 2013, 06:03:03 am »
That's because the API changed a lot since 1.6. Get rid of all your code and start again.

You can use the code from here: http://sfml-dev.org/tutorials/2.1/start-linux.php
For API reference just use the online reference pages: http://sfml-dev.org/resources.php
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).