Sign in to follow this  

Rendering alot of objects

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

Up till now I wrote a few some basic games. But I want to move on and develop a 2D top down scroller. I've been thinking about rendering all the game objects. What would be a the way of rendering everything? Write a CRenderer class which handles intializing Direct3D 9, loading all the bitmaps and just taking up CRenderable objects which it will then render to the screen? I also had the idea of adding a Render() function to all the objects but that seems to be slow to me. Also, having a single CRender class which does all the graphics makes it porting to a different API/platform alot easier. Toolmaker

Share this post


Link to post
Share on other sites
I have a Render() function in every object in the game, but BBB's method would be good, too. The only problem is that it's harder to have special rendering methods for different types of objects, which is why I use a Render() function in every object. Then I just run through the list of objects in the game and update them and render them.

Share this post


Link to post
Share on other sites
I think that having each object to do it's own rendering might be a better solution, except it's less easy to port to a different API(Perhaps we should wrap the render functions).

Thx for the info, I need to look over a design.

Toolmaker

Share this post


Link to post
Share on other sites
as it's for a 2D game, if you really need to render a lot of objects in 3D, you might pre-render each object in sprites at the start of your game, and then use them as textures, surfaces or simple-sprites during your gameloop...

Share this post


Link to post
Share on other sites

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