Jump to content
  • Advertisement
Sign in to follow this  
exgex

OpenGL game programming logic problem

This topic is 4061 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!