SFML community forums

Help => Window => Topic started by: HardCoded on November 07, 2011, 12:17:32 am

Title: Focus on Window?
Post by: HardCoded on November 07, 2011, 12:17:32 am
I'm using SFML2.0 and VC++2010 and when I compile and run this:
Code: [Select]

int main () {
sf::RenderWindow App(sf::VideoMode(X_RATIO, Y_RATIO, 32), WINDOW_TITLE);
App.SetFramerateLimit(32);
while (true) {
App.Display();
}
return 0;
}

I can't seem to 'click' on the window it creates or move it about or do anything with it.
However, I can interact with the console window that opens up with it.

Am I missing something?
Title: Focus on Window?
Post by: Felheart on November 07, 2011, 12:40:24 am
pumping the message queue?

In C# it's App.DispatchEvents();
There should be something similar in the original c++ version
Title: Focus on Window?
Post by: HardCoded on November 07, 2011, 02:22:33 am
Ahh..
Got it working now.
I just added this to the loop: App.PollEvent(sf::Event());
I used a temporary sf::Event because I don't need the Events for now.

Thanks.
Title: Focus on Window?
Post by: Laurent on November 07, 2011, 07:54:50 am
Quote
I just added this to the loop: App.PollEvent(sf::Event());

This is not valid C++ (passing a temporary as a non-const reference), I suggest that you configure your compiler so that it doesn't silently skip this kind of error ;)