Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I have read whole tutorial section on sfml-dev.org and have some question.

What are exactly views and how to use them ?

Should I render things in views or in renderwindow ?

share|improve this question
add comment

1 Answer 1

Views in SFML, like it says in the docs, are like 2D cameras. Essentially it represents what you would see through a camera and allows you to zoom in or out and to scroll in any direction easily. Doing this with a RenderWindow would mean that in order to zoom in, you would need move/scale every sprite. Same thing for scrolling, you would need to move every sprite on screen depending on the scroll direction.

On the other hand I have used sfml once, to make a multiplayer 2D shooter. I didn't use views at all when doing all the rendering. Everything was drawn directly to the RenderWindow and I had no performance problems or anything else.

share|improve this answer
    
thank you very much man –  user6310 Mar 25 '11 at 15:47
    
Why is this answer CW? –  user744 Mar 25 '11 at 18:18
    
Good question! must have clicked that by mistake. My bad. –  dotminic Mar 25 '11 at 18:21
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.