Sign in to follow this  

How to do a render function?

This topic is 4778 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

Im struggling to understand how exactly to do this. In my engine I want a function (simply "Render()") that draws everything that needs to be drawn in a frame. Before I get to it I need to understand how to do it - ie what needs to go in it, how to structure it etc. Can anyone help explain it to me? Cheers :)

Share this post


Link to post
Share on other sites
You may need to ask some more specific questions. A 'render' function can be arbitrarily complex depending on what features you're trying to support, and is often broken up into smaller functions. So what exactly do you want to achieve?

For a simple case, though:

1. Clear color and z buffers
2. Render static objects
3. For each dynamic object
a) Push matrix
b) Set model matrix
c) Render model
d) Pop matrix
4. Flip buffer

That's off the top of my head, so I may have missed something.

Share this post


Link to post
Share on other sites

This topic is 4778 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this