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

Author Topic: Windows not opening correctly?  (Read 4058 times)

0 Members and 2 Guests are viewing this topic.

Samyboy

  • Newbie
  • *
  • Posts: 19
    • View Profile
Windows not opening correctly?
« 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

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Windows not opening correctly?
« Reply #1 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?
Laurent Gomila - SFML developer

Samyboy

  • Newbie
  • *
  • Posts: 19
    • View Profile
Windows not opening correctly?
« Reply #2 on: February 06, 2010, 06:56:07 pm »
I'm using SFML 1.5 and both:

- Windows 7 64 Bit
- Windows XP 32 Bit

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Windows not opening correctly?
« Reply #3 on: February 06, 2010, 07:05:21 pm »
Can you show your code?
Laurent Gomila - SFML developer

Samyboy

  • Newbie
  • *
  • Posts: 19
    • View Profile
Windows not opening correctly?
« Reply #4 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

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Windows not opening correctly?
« Reply #5 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?
Laurent Gomila - SFML developer

Samyboy

  • Newbie
  • *
  • Posts: 19
    • View Profile
Windows not opening correctly?
« Reply #6 on: February 06, 2010, 08:05:13 pm »
[/img]

It stays like that untill I press a Key, click or move the window...

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Windows not opening correctly?
« Reply #7 on: February 06, 2010, 11:12:44 pm »
Have you tried the precompiled samples provided in the SDK?
Laurent Gomila - SFML developer

 

anything