SFML community forums
Help => Window => Topic started by: Samyboy on February 06, 2010, 05:28:00 pm
-
Hello,
When I create an sf::RenderWindow, the window itself opens all fine, but at the taskbar it doesn't show correctly untill I move/resize it or do any Events on it.
Is there a way to solve this? Because it is very ugly :D
-
Hi
Which version of SFML ? Which OS ? If Linux, do you use Compiz or any other OpenGL based WM?
-
I'm using SFML 1.5 and both:
- Windows 7 64 Bit
- Windows XP 32 Bit
-
Can you show your code?
-
#include <SFML/Window.hpp>
#include <SFML/Network.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/System.hpp>
using namespace std;
int main() {
sf::RenderWindow theWindow(sf::VideoMode(352, 352, 32), "HEllo World", sf::Style::Close);
theWindow.Display();
sf::Event Event;
while (theWindow.IsOpened()) {
while (theWindow.GetEvent(Event)) { // Get all the Events (User Input) and handle them
if (Event.Type == sf::Event::Closed)
theWindow.Close();
}
Sleep(1); // To reduce CPU-Usage
}
return 0;
}
I'm using CodeBlocks
-
This code works fine for me (Windows XP 32 bits).
What do you mean by "it doesn't show correctly"? Can you show a screenshot?
-
(http://img294.imageshack.us/img294/5840/80886647.jpg)[/img]
It stays like that untill I press a Key, click or move the window...
-
Have you tried the precompiled samples provided in the SDK?