Book Image

Direct3D Rendering Cookbook

By : Justin Stenning, Justin Stenning
Book Image

Direct3D Rendering Cookbook

By: Justin Stenning, Justin Stenning

Overview of this book

Table of Contents (19 chapters)
Direct3D Rendering Cookbook
About the Author
About the Reviewers
Further Reading

Using the sample rendering framework

To work with complex scenes more easily, we are going to explore a set of classes that will serve as our simple rendering framework throughout the book. This framework will take care of initializing our Direct3D device, swap chain and render targets, and provide appropriate methods and events for implementing the Direct3D resource lifecycle management in our example applications.

The three key elements of this framework include the following:

  • Device manager: This is a class that manages the lifecycle of our Direct3D device and device context.

  • Direct3D application: This is a set of classes that manage our swap chain and render targets, along with other common-size dependent resources, such as the depth/stencil buffer and viewport setup. We descend from one of these to create our Direct3D application/render loop.

  • Renderer: This is a small class that we use to implement a renderer for a single element/area of a scene. We create instances of these within our...