game programming logic problem

Started by
1 comment, last by servo 16 years, 5 months ago
i have a problem, if i can only call rendering code between beginscene and endscene, how do i make a real game that runs linearly thx in opengl i can render anywhere, but in directx, it seems to be a whole different ball game i cant possibly fit all my code between the renderFrame function right? EDIT: At the moment i am using a finite state machine, is this the correct way to do it? [Edited by - exgex on November 2, 2007 1:10:08 AM]
Advertisement
usually you do all your game logic first in the loop, then all the rendering.
This way everything like object movement, physics, etc is all updated before you draw anything...then its a just a matter of doing all needed transforms and culling and sending it into the pipe.
I don't know exactly what you really ask....

in FrameMove function this matrix is only defined once
because there is the only one SetTranform for matWorld in this function.

and when your render object in

in DrawFrame function, all object is referenced with a single matWorld after calling FrameMove.

why don't you try this in FrameMove:
1. any changing in matrix of object1
2. any changing in matrix of object2

why don't you try this in DrawFrame:
1. beginscene
2. setTransform world with matrix of object1
3. draw your object1 here
4. setTransform world with matrix of object2
5. draw your object2 here
6. endscene

i'm sure that both object draw in different position based on their own matrix...

This topic is closed to new replies.

Advertisement