SFML community forums

Help => Window => Topic started by: Samyboy on February 06, 2010, 05:28:00 pm

Title: Windows not opening correctly?
Post 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
Title: Windows not opening correctly?
Post by: Laurent on February 06, 2010, 05:41:05 pm
Hi

Which version of SFML ? Which OS ? If Linux, do you use Compiz or any other OpenGL based WM?
Title: Windows not opening correctly?
Post by: Samyboy on February 06, 2010, 06:56:07 pm
I'm using SFML 1.5 and both:

- Windows 7 64 Bit
- Windows XP 32 Bit
Title: Windows not opening correctly?
Post by: Laurent on February 06, 2010, 07:05:21 pm
Can you show your code?
Title: Windows not opening correctly?
Post by: Samyboy on February 06, 2010, 07:40:56 pm
Code: [Select]
#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
Title: Windows not opening correctly?
Post by: Laurent on February 06, 2010, 07:58:15 pm
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?
Title: Windows not opening correctly?
Post by: Samyboy on February 06, 2010, 08:05:13 pm
(http://img294.imageshack.us/img294/5840/80886647.jpg)[/img]

It stays like that untill I press a Key, click or move the window...
Title: Windows not opening correctly?
Post by: Laurent on February 06, 2010, 11:12:44 pm
Have you tried the precompiled samples provided in the SDK?