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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Robert42

Pages: 1 2 [3]
Feature requests / Window::SetSize(0, 0)
« on: August 29, 2011, 10:38:28 pm »
Hello Guys,

First: I am new to SFML and already love it! So I want to contribute with a small Feature-Request ;)

I had a small issue today. My Applicatio crashed with the message:
Code: [Select]
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  12 (X_ConfigureWindow)
  Value in failed request:  0x0
  Serial number of failed request:  64
  Current serial number in output stream:  64

After one hour work I figured out I accidentally called Widnow::SetSize with width==0 and height==0

It's no problem for me anymore, but for other new users it could be nice if some sort af error message (warning in console?) could telll them illegal size values has been used. Maybe we could use in Window.cpp something like this?
Code: [Select]
void Window::SetSize(unsigned int width, unsigned int height)
    if(width <= 0)
        Err() << "Window width must be > 0" << std::endl;

    if(height <= 0)
        Err() << "Window height must be > 0" << std::endl;

    if (myWindow)
        myWindow->SetSize(width, height);

PS: I could reproduce it on two different Linux-Computers (one with NVidia and one with Intel GPU) so I don't think this to be a problem of my drivers.

best regards,

Pages: 1 2 [3]