Theoretic question about rendering in sfml and in general

  • Theoretic question about rendering in sfml and in general user6310

    I have read whole tutorial section on and have some question.

    What are exactly views and how to use them ?

    Should I render things in views or in renderwindow ?

  • 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.

c++ game-mechanics sfml
Related questions and answers
  • Lately I have been working on a game that i plan to make online. I have used different libraries to make this game as far as i could, but I feel that I should rethink on how Im sertting this game up, so I planned to start over. The libraries that I have used are SFML, OpenGL, and Bullet Physics, along with GLM to load the models. But the problem is that the 3D graphics arent working with the Physics correctly... So my main question is: What would be a good combination of libraries to make an online game with? Im sure that many people have good combinations of libraries for making a game

  • I want to be able to move a sprite from a current location to another based upon where the user clicks in the window. This is the code that I have: #include <SFML/Graphics.hpp> int main() { // Create the main window sf::RenderWindow App(sf::VideoMode(800, 600), "SFML window"); // Load a sprite to display sf::Texture Image; if (!Image.LoadFromFile("cb.bmp...(); } return EXIT_SUCCESS; } But instead of just setting the position I want to use Sprite.Move() and gradually move the sprite from one position to another. The question is how? Later I plan on adding a node

  • no professional, and I don't have a clear view of "how-to" yet. I am using SFML with C++. ... Possible Duplicate: When to roll your own game engine? I've been interested in writting games for a while, and now that I have acquired a bit of experience in programming, I feel like I could step up to making a little more complicated things. I've had some fun with SFML but since now I only had the basic classes I needed for my game objects, and a big run() method of my Game object

  • I'm trying to make a GUI library with SFML, and everything's done except for one problem: making the interface stay still even when the camera moves or zooms in and out. This would be easy to fix if zooming wasn't possible, but zooming out means having to scale the contents of the interface up so it doesn't shrink, which causes it's text/images to become blurry. Does anyone have a way to get around this issue (preferably only using SFML as I don't want to make my library OpenGL-dependent)?

  • I'm wondering if there is a simple way to convert 3D coordinates to 2D coordinates. Also, if it's possible, to convert in the reverse direction. I'm using OpenGL(GLUT) in my C++ project. I am also using SFML for the 2D information (sprites text etc.) I found out that I can use gluProject(), but I have no idea how to use this. I'm asking for a simple example of using gluProject() or another example to convert 3D coordinates (such as from the player) to 2D coordinates. If I can't get the simple process I'm confident that I can figure out the rest.

  • I'm working with SFML right now, and upon finishing the tutorials I still do not know how to give a shape a texture or image -- not just a solid color/outline. The only thing I know can take an image is a sprite, but thats way to simple, as it only allows you to render rectangular images in a rectangluar way! What are the techniques for rendering images onto shapes, and only inside the shape? It would be great if some of you could provide some resources or SFML-specific stuff!

  • using the boost library extensively and have been using SFML for graphics and FMOD for audio. I have a fair bit of code written, but am considering scrapping it and starting over. Here's the major areas of concern I have and wanted to get some opinions on the proper way others have solved them or would solve them. 1. Cyclical Dependencies When I was doing the game in C#, I didn't really have to worry about this since it isn't an issue there. Moving to C++, this has become a fairly major problem and made me think I may have designed things incorrectly. I can't really imagine how to decouple

  • The game I've been working on uses opengl/sfml for graphics. I'm currently working on the interface and I've found determining all the proper offsets/positioning etc. to be a pain. To make it configurable, I'll likely end up parsing a making a bunch of xml files to parse that tell my program what images to use/where to position them stc. for the interface. Since I'm going to need to do that anyways, I was curious if it's possible to embed an html renderer into an app, and have it display over graphics drawn in opengl? That way i could theoretically use html pages to design the interface

  • I'm new to Game programmming and SDL, and I have been following Lazyfoo's SDL tutorials. My question is related to time based motion and frame rate based motion, basically which is better or appropriate depending on situations?. Could you give me an example where each of these methods are used?. Another question I have is that, in lazyfoo's two Motion tutorials (FPS based and time based... position when you compare the two programs. As beginner which method should I stick to?(all I want is smooth animations).

Data information