Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


The Render

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

Is it better practice to have your render function collect data from objects (Position etc) and then draw the objects to the screen, or is it better to give the objects their own drawing functions and just have the render function determine the order for things to be drawn and just have the objects on the board draw themselves?

Share this post

Link to post
Share on other sites
i prefer to have the renderfunction to choose how to draw, and the object has a function draw() that sends then it''s actual data and information (to the gpu)..

that way, i can implement for example sketchy,cartoony,or what ever sort of rendering by replacing the renderingfunction, and i can even go multipass if i need by replacing the renderingfunction. the objects can still draw themselves the same way.. it''s sort of
the object knows how it looks like
the viewer knows how it views stuff
and together, you get a nice image

"take a look around" - limp bizkit

Share this post

Link to post
Share on other sites
Well, I prefer another aproach:
Each object has a list of "view interfaces" - all derived from a base class. I can add/remove such view interfaces to an object and call the object to view itself using one interface... Basically, the object is just a physical mesh object, so it does not know how to view itselfs -> so the view interfaces.
That way you can write a view interface for GDI, for raytrace, for OGL, DX... whatever. The base view interface just knows how to access object geometrical data.
That''s the basic ideea. Stuff can get more rafinated.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!