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

Author Topic: Wrong size of window  (Read 4378 times)

0 Members and 1 Guest are viewing this topic.

reDo

  • Full Member
  • ***
  • Posts: 104
    • View Profile
Wrong size of window
« on: June 05, 2011, 11:32:01 am »
I used this command, but it creates windows with 111 and 200
Code: [Select]
sf::RenderWindow App(sf::VideoMode(100, 200, 32), "Eye");
Where can be problem?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Wrong size of window
« Reply #1 on: June 05, 2011, 11:51:02 am »
How do you know that the width is 111?
Laurent Gomila - SFML developer

reDo

  • Full Member
  • ***
  • Posts: 104
    • View Profile
Wrong size of window
« Reply #2 on: June 05, 2011, 12:17:55 pm »
Because I measured it, here is example to show, what am I doing wrong please?
Code: [Select]
#include <SFML/Window.hpp>
#include <SFML/System.hpp>
#include <SFML/Graphics.hpp>


int main()
{
    sf::RenderWindow App(sf::VideoMode(100, 200, 32), "Eye");

    while (App.IsOpened())
    {

        sf::Event Event;
        while (App.GetEvent(Event))
        {
            // Close window : exit
            if (Event.Type == sf::Event::Closed)
                App.Close();

            // Escape key : exit
            if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape))
                App.Close();
        }

        App.Clear(sf::Color(64,64,64));

        App.Draw(sf::Shape::Circle(100, 10, 5, sf::Color(128,255,0)));

        App.Display();
        sf::Sleep(0.025f);
    }


    return EXIT_SUCCESS;
}


Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Wrong size of window
« Reply #3 on: June 05, 2011, 12:33:01 pm »
There's nothing wrong with your code, actually.
Laurent Gomila - SFML developer

reDo

  • Full Member
  • ***
  • Posts: 104
    • View Profile
Wrong size of window
« Reply #4 on: June 05, 2011, 12:56:19 pm »
but why has the windows width 111 and no 100 like I want?

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Wrong size of window
« Reply #5 on: June 05, 2011, 01:07:37 pm »
Are you counting the borders too?
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

reDo

  • Full Member
  • ***
  • Posts: 104
    • View Profile
Wrong size of window
« Reply #6 on: June 05, 2011, 01:14:40 pm »
no, you can see the problem picture, there I draw circle on x 100 but it is not on good position

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Wrong size of window
« Reply #7 on: June 05, 2011, 01:36:11 pm »
Quote
but why has the windows width 111 and no 100 like I want?

I don't know.
Laurent Gomila - SFML developer

reDo

  • Full Member
  • ***
  • Posts: 104
    • View Profile
Wrong size of window
« Reply #8 on: June 05, 2011, 01:39:35 pm »
I thought someone will know when here are more experienced users :( and you are SFML developer.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Wrong size of window
« Reply #9 on: June 05, 2011, 01:45:58 pm »
I'm sorry but this is really strange. It's a very basic thing, and nobody had experienced this bug before you.

What happens if you use a different size? Is the real size always greater by 11 pixels? What is your OS? Do you use SFML 1.6?
Laurent Gomila - SFML developer

reDo

  • Full Member
  • ***
  • Posts: 104
    • View Profile
Wrong size of window
« Reply #10 on: June 05, 2011, 02:02:34 pm »
OS: Windows XP SP3, SFML 1.6, CodeBlocks - MinGW,  
window x 110, real x 111
window x 20,real x 111
y works good (I tried it with 20 and it works fine), it looks like some limit or something

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Wrong size of window
« Reply #11 on: June 05, 2011, 02:06:27 pm »
Quote
window x 20,real x 111

Width is always 111 ?!
Laurent Gomila - SFML developer

reDo

  • Full Member
  • ***
  • Posts: 104
    • View Profile
Wrong size of window
« Reply #12 on: June 05, 2011, 02:49:22 pm »
window x 120, real 120 so I think only when window width is equal or less than 111

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Wrong size of window
« Reply #13 on: June 05, 2011, 03:30:05 pm »
Oh, ok I see. That's the minimum window width that the OS allows, so that the icon and buttons can fit in the title bar.
Laurent Gomila - SFML developer

reDo

  • Full Member
  • ***
  • Posts: 104
    • View Profile
Wrong size of window
« Reply #14 on: June 05, 2011, 04:26:05 pm »
So I cannot do  anything with it? because I want window's width 100 pixels

 

anything