We get it. We use ad blockers too. But GameDev.net displays them so we can continue to be a great platform for you.
Please whitelist GameDev.net and our advertisers.
Also consider a GDNet+ Pro subscription to remove all ads from GameDev.net.
Jump to content
This is not recommended for shared computers
Sign in anonymously
Don't add me to the active users list
Nov 15 2016 10:56 AM | 2 Comments
Nov 08 2016 01:45 PM | 4 Comments
Sep 22 2016 02:18 PM | 6 Comments
Oct 07 2016 12:42 PM | 1 Comments
Sep 14 2016 07:04 PM | 13 Comments
Aug 29 2016 11:40 AM | 5 Comments
Oct 20 2016 12:15 PM | 3 Comments
Show more » | View all recent resources»
Zachary Booth Simpson
| Published Jun 19 2001 05:27 PM in General Programming
Pass-off special render cases to Model code.
Generic View code often becomes clotted with special cases, especially near the end of a project. Render Delegation gets the special cases out of the View code and into Model subclasses.
An example clot in View code: if (typeToDraw==DARTH_VADERS_SHIP)
drawSpecialShieldEffect();To encapsulate these kinds of special cases, the View delegates the draw back to the Model. For example: objectToDraw->draw(x,y) It is common for the view to do the transformation and sorting work and pass screen coordinates to the draw method of a model.
Not available at this time.
No examples at this time. Email firstname.lastname@example.org to contribute.
Use Render Delegation when:You want to ensure reusability / encapsulation of the renderer.The View code becomes clotted with special cases.Every model tends to have a different implementations of render. Don't use Render Delegation when:There are only a few special cases and the cost (compile time, encapsulation) of including render interfaces in Model code is very high.
Render Delegation passes draw commands from View to Model. Render Delegation may be part of an Appearance Map.
GameDev.net™, the GameDev.net logo, and GDNet™ are trademarks of GameDev.net, LLC