SFML community forums

Help => Graphics => Topic started by: Putarda on October 23, 2016, 05:12:33 pm

Title: Does opengl renders off the screen sprites? And more questions.
Post by: Putarda on October 23, 2016, 05:12:33 pm
So basicly I have few question that I need to know to continue my Engine  ;D.

1. Does opengl render off the screen shapes (sf::Rectangle, sprite...). For example if rectangle position is at 1281 but screen is 1280, will it be rendered?
2. Is it true that 2D games screen is just a plane in 3D space with texture on it? Like this: (http://www.third-helix.com/images/2012/02/perspective.jpg)
3. When I'm making my infinite runner, is it better to move my camera (sf::view) and generate map when it needs to appear or to just move all sprites at the opposite running direction and generating a map when it needs to appear?
4. Similar as third question, when I make my adventure game. Do I need to load my whole scene/map at the beggining, or to generate it when it needs to appear?

5. And one more important question. At the beggining of the game, should I load all objects, entities and particles to resource map. And when I need for example to spawn enemy, I just take that entity type from resource map and duplicate it in my other map called screen map which will render it and share it. Is that good mechanism for my Engine?

I'm making my first engine, and I'm looking it to be good as possible. I hope someone can answer my questions. Thanks.
Title: Re: Does opengl renders off the screen sprites? And more questions.
Post by: DarkRoku12 on October 24, 2016, 02:02:25 am
The first question is answered here (http://gamedev.stackexchange.com/a/17300).
2) OpenGL is a 3D graphics API, so its just 2D without depth. 3D involves volume. (A more complete answer can be given by a more expert openGL user or just google it)
3) Its far better to move the view.
4) Depends on the size (mb) of the assets.
5) Share when you can share, duplicate when you really need two instances of the same object.