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

Author Topic: Does opengl renders off the screen sprites? And more questions.  (Read 1835 times)

0 Members and 1 Guest are viewing this topic.

Putarda

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
Does opengl renders off the screen sprites? And more questions.
« 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:
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.

DarkRoku12

  • Full Member
  • ***
  • Posts: 203
  • Lua coder.
    • View Profile
    • Email
Re: Does opengl renders off the screen sprites? And more questions.
« Reply #1 on: October 24, 2016, 02:02:25 am »
The first question is answered here.
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.



I would like a spanish/latin community...
Problems building for Android? Look here

 

anything