SFML community forums

Help => Graphics => Topic started by: CreaM on April 08, 2014, 07:26:45 pm

Title: more views problem
Post by: CreaM on April 08, 2014, 07:26:45 pm
Hello, iv got two views, when i use just one its ok. But when i use both it apperars just one...
sf::View tools;
        tools.setViewport(sf::FloatRect(0.5f, 0, 0.5f, 1));
        tools.setCenter(0, 0);
        tools.zoom(0.05f);

        sf::View clasic;
        clasic.setViewport(sf::FloatRect(0, 0, 1, 1));
        clasic.setCenter(0, 0);
 
-from beginning of main(), and than window.setView(clasic);window.setView(tools);in loop.
in pixel 0, 0, there is rect. shape and it apears just in tools view...
Do you know where is mistake?
Thanks
   
      
Title: Re: more views problem
Post by: eXpl0it3r on April 09, 2014, 01:32:47 am
Do you know where is mistake?
Not reading the view tutorial (http://www.sfml-dev.org/tutorials/2.1/graphics-view.php)? ;)

You set a view, then you draw the related objects, then you set the other view and you draw the other objects. How else would one know what to draw where?