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
Dec 27 2016 04:51 PM | 7 Comments
Dec 15 2016 11:03 AM | 4 Comments
Nov 15 2016 11:56 AM | 4 Comments
Nov 08 2016 02:45 PM | 5 Comments
Sep 22 2016 03:18 PM | 5 Comments
Jan 03 2017 02:22 AM | 0 Comments
Oct 07 2016 01:42 PM | 1 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 email@example.com 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