Jump to content
  • Advertisement
Sign in to follow this  
derek7

how to design my render()

This topic is 4756 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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!