Sign in to follow this  

how to design my render()

This topic is 4594 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 should let render() a method of a mesh then write extra a loop for render all object or a global function that render a list of all object in a scene? the same problem: If I do collision detection,I should let the function a method of a mesh object or a global function?

Share this post


Link to post
Share on other sites
I personally ended up allowing it to be "specific" for each object -- that way I can optimize on an on object basis, with on large "render core" that called each sub-objects render method.

When each object updates itself, it checks whether it needs to be rendered. If it does, it adds itself to the render core...and each loop the render core goes through all the objects that need to be rendered and calls their "render()" method. This does mean, though, that all objects that are renderable inherit from the same "renderable" abstract class, which allows me to put them all in the same vector.

Its really a personal style choice.

Share this post


Link to post
Share on other sites

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