O'Reilly logo

Game Development with SlimDX by Michael Fontanini

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Rendering a cube

In this section we will render a cube since it is actually 3D, unlike our triangle in the previous demo. We will modify the project from the previous demo to create the cube demo. In the downloadable code for this chapter, you will find the code for the cube demo in a separate project so you can look at the code for both demos. The Triangle project is set as the startup project by default. When you want to run the Cube demo, remember that you will have to set the Cube project as the startup project to run it.

To get started, we will add an enumeration named GraphicsMode. We will use it to specify how we will render our cube. This enumeration looks like the following:

enum GraphicsMode { SolidBlue = 0, PerVertexColoring, Textured ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required