O'Reilly logo

Windows Phone 7 XNA Cookbook by Zheng Yang

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

Customizing vertex formats

In XNA 4.0, a vertex format has a description about how the data stored in the vertex allows the system to easily locate the specified data. The XNA framework provides some built-in vertex formats, such as VertexPositionColor and VertexPositionNormalTexture format. Sometimes, these built-in vertex formats are limited for special effects such as particles with life limitation. At that moment, you will need to define a custom vertex format. In this recipe, you will learn how to define the custom vertex format.

How to do it...

Now let's begin to program our sample application:

  1. Create a Windows Phone Game project named CustomVertexFormat, change Game1.cs to CustomVertexFormatGame.cs. Add a new class file CustomVertexPositionColor.cs ...

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