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

Author Topic: SFML app does nothing  (Read 2559 times)

0 Members and 1 Guest are viewing this topic.

N_K

  • Jr. Member
  • **
  • Posts: 64
    • View Profile
SFML app does nothing
« on: March 14, 2012, 11:33:29 pm »
Hello all.

Today I decided to go ahead and familiarize myself with SFML. So I set it up, and started with the "Opening a window" tutorial. It compiled fine (of course), but when I started the executable, all I got was the wait cursor for about 5 seconds, then nothing. I opened the task manager, and the application was apparently running in the background, but did nothing.

Then I compiled another tutorial ("Using render windows"), and it did exactly the same thing.

I'm on Win7 (64-bit), and my compiler is Visual Studio 2010 Express. Could anybody help me out with this, please?

Also, here is the code I used:
Code: [Select]
#include <SFML/System.hpp>
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>

int main(void)
{
sf::RenderWindow App(sf::VideoMode(800, 600, 32), "Test");

while (App.IsOpened())
{
sf::Event Event;

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

App.Clear();
App.Display();
}

return EXIT_SUCCESS;
}


Thank you in advance.

Zephilinox

  • Newbie
  • *
  • Posts: 43
    • View Profile
SFML app does nothing
« Reply #1 on: March 15, 2012, 03:01:26 am »
are you using sfml 1.6? I've heard there are problems in 1.6 about people using ATI graphic cards, it might be related to your problem if you have one.

Tex Killer

  • Full Member
  • ***
  • Posts: 242
    • View Profile
SFML app does nothing
« Reply #2 on: March 15, 2012, 03:40:44 am »
You must use binaries made with Visual Studio 2010 if you are also using it. There are some user-compiled binaries on the forum, and some information on how to compile SFML yourself as well. Just search a little.

Also pay attention to what Zephilinox posted.

N_K

  • Jr. Member
  • **
  • Posts: 64
    • View Profile
SFML app does nothing
« Reply #3 on: March 15, 2012, 04:14:41 am »
Thanks everybody.

Since I'm using the prebuilt VS2008 libraries, that might be the problem. I'll recompile SFML later and see what happens.

And I don't think this problem is related to ATI cards. I have one, and every SFML apps I've tried so far worked absolutely fine.

Tex Killer

  • Full Member
  • ***
  • Posts: 242
    • View Profile
SFML app does nothing
« Reply #4 on: March 15, 2012, 05:27:32 am »
The ATI problem only happens with SFML 1.6.
If you are using SFML 2 you should not have to worry about it.

N_K

  • Jr. Member
  • **
  • Posts: 64
    • View Profile
SFML app does nothing
« Reply #5 on: March 15, 2012, 04:45:13 pm »
I'm using 1.6, and all the apps I tried were using 1.6 as well.

I took a look around the forum, and found pre-build VS2010 libs only for SFML 2, so I tried to recompile 1.6 myselfs.

For some reason, only the static libraries were built (the only exception is sfml-main), even if I didn't select the static target. Well, not really, the DLLs were built as well, but without their counterpart *.lib files, so they're unusable.

However, with these static libs, the test app is now works fine.