Render Delegation
Pass-off special render cases to Model code.
[size="5"]Intent
[size="5"]Problem
[size="5"]Solution
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.[/bquote]
[size="5"]Examples
[size="5"]Issues and Risks
- 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.[/bquote]
- There are only a few special cases and the cost (compile time, encapsulation) of including render interfaces in Model code is very high.[/bquote]
[size="5"]Related Patterns
Render Delegation may be part of an Appearance Map.[/bquote]
Related Tutorials
Balancing Game Development and Creative Direction in Indie Production
A practical look at how indie developers can balance creative direction with hands-on game development. This article co…
My Unreal Engine Development Process: From Core Idea to Playable Build
A practical overview of my Unreal Engine development process, covering how I move from a core game idea to a playable b…
Introducing LaneGraph: The Ultimate Road Network Solution for Unity
Discover the power of LaneGraph, a lightweight and flexible lane-based navigation system for Unity. LaneGraph makes it…
Retargeting Mixamo Characters with Root Motion In Unreal Engine 5.4.
I have always found Retargeting Mixamo Characters To have Root Motion is a serious lengthy Tast, Recently I stumbled up…
How To Make A SIMPLE Main Menu In Unity
In this tutorial for unity, i go over how to make a simple main menu for unity, it's an unlisted video because i do not…
Guide to Gameplay Balance
A perspective on competitive gameplay balance, from a background of "shooter" sandbox design.
Discussion
More from Zachary Booth Simpson
Comparing Shadow Mapping Techniques with Shadow Explorer
New Incentives and a Whole New Platform From The Intel AppUp developer program
The final installment in this series on Intel's AppUp program details additional incentives and opportunities for devel…
The Game Maker
This book excerpt contains the first chapter of the book that introduces beginning game developers to the Game Maker pr…
Discussion