PDA

View Full Version : Where do I put calculations?



Neomex01
12-14-2010, 10:06 AM
Where I have to put calculations? In draw function?

Neomex01
12-14-2010, 12:47 PM
Anyone?

Alfonse Reinheart
12-14-2010, 01:32 PM
You didn't provide any information or describe a problem. We do not know what calculations you are referring to.

Neomex01
12-15-2010, 02:26 AM
For example physics one, collision checking, etc.

Alfonse Reinheart
12-15-2010, 02:45 AM
Unless you are doing GPGPU to do them, physics and collision checking has nothing to do with OpenGL.

Neomex01
12-15-2010, 02:58 AM
But every single game has some physics and collision checking, so I want to know, if it does matter where I put it, or I can put it wherever I want to.

ugluk
12-15-2010, 06:32 AM
You can put them into another thread than the rendering thread, if that is what you wanted to know. Or you can do your calcs on the GPU, using your favorite technique..

V-man
12-15-2010, 09:29 AM
I think he is just asking a simple question here.
You can put your calculations in the draw function or another function or another class. You can make a free function if you want.

The question is in regards to learning to be a programmer.

Rosario Leonardi
12-15-2010, 01:22 PM
Read this, is far better then try to answer a complex question in two lines
http://www.gamasutra.com/view/feature/1830/multithreaded_game_engine_.php


The difficult part is to synchronize the data and the 3d models. There are a lot of technique to do that.