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

Author Topic: simple drawing shape problem  (Read 2248 times)

0 Members and 1 Guest are viewing this topic.

wgan

  • Newbie
  • *
  • Posts: 10
    • View Profile
simple drawing shape problem
« on: June 08, 2014, 04:21:07 pm »
Hi I use the code from http://www.sfml-dev.org/tutorials/2.1/start-vc.php to draw a simply circle, i run it in vs2013, the prpgram doesn't show the circle but the blank screen at the beginning until you change the windows size by dragging the border or maximizing the window,  then the circle shows up all good, why it doesn't show immediately when the program started?

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: simple drawing shape problem
« Reply #1 on: June 08, 2014, 04:24:45 pm »
And where did you get SFML from?
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: simple drawing shape problem
« Reply #2 on: June 08, 2014, 04:31:18 pm »
Since there are no official prebuild binaries for vs2013 I assume you've rebuild SFML for vs2013 yourself. If not, then you are using an unsupported setup and I'm surprised the program even runs - in any case, if this is the situation then all bets are off.

wgan

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: simple drawing shape problem
« Reply #3 on: June 08, 2014, 07:25:10 pm »
Since there are no official prebuild binaries for vs2013 I assume you've rebuild SFML for vs2013 yourself. If not, then you are using an unsupported setup and I'm surprised the program even runs - in any case, if this is the situation then all bets are off.

yes i built SFML from source(latest version>2.1) in vs2013 express, and that circle program is statically linked, it just doesn't show the circle immediately, but when you set the window background into some colour (e.g. window.clear(sf::Color::Green)) the background colour shows up all right once the program runs, since i use the latest source, wouldn't it be SFML changed something in the latest version?

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: simple drawing shape problem
« Reply #4 on: June 08, 2014, 08:29:55 pm »
Could you post the actual code you are using?
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

wgan

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: simple drawing shape problem
« Reply #5 on: June 09, 2014, 03:54:59 am »
Could you post the actual code you are using?

#include <SFML/Graphics.hpp>

int main()
{
        sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
        sf::CircleShape shape(100.f);
        shape.setFillColor(sf::Color::Green);

        while (window.isOpen())
        {
                sf::Event event;
                while (window.pollEvent(event))
                {
                        if (event.type == sf::Event::Closed)
                                window.close();
                }

                window.clear();
                window.draw(shape);
                window.display();
        }

        return 0;
}
 


wgan

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: simple drawing shape problem
« Reply #6 on: June 09, 2014, 04:21:20 am »
ok I tried the vs2013 build from http://www.nightlybuilds.ch/
everything is set up the same, statically linked as well, that build worked as expected, the circle shows up at the beginning, I wonder what causes my build not working as expected (strangely the code compiled, linked and ran all well except this little glitch)??