Speaking of games, most developers must first think of 3D game engines such as C ++ or DirectX. In Windows phone8, we also support C ++ and Direct 3D development, today, I will introduce this development mode to you.
First, let's explain it to your home, in Windows phone8, Microsoft does not provide an interface that directly supports C ++ to call winrt like Windows 8. Therefore, it is a pity that some of Windows phone8's features are in C ++. yes.
Of course, if our game needs to use the above features, we can also use the hybrid development model for development, the Mixed Development Mode templates are divided into two types: "XAML and direct3d project templates" and "direct3d and XAML" project templates.
The "XAML and direct3d Project template" is hosted in the original XAML +CodeIntroduce a drawingsurface control in the development mode of the control. The control is also a subclass of frameworkelement In the UI and can be used as a control in the XAML file.
In addition, the "direct3d and XAML Project template" is a drawingsurfacebackgroundgrid control that must be used for integration and grid control as the root node of the page (that is, the background will overwrite the entire page) in addition, the Development template runs more efficiently than the former.
Advantages of the hybrid development model-this development template has a complete UI framework and a complete page declaration cycle, allowing rapid and simple application development and flexible use of the direct3d control to be displayed on the XAML page, you can also use the hosted code to call local code and call the special features of Windows phone8.
The pure Direct 3D development mode is more suitable for complex 3D games and cross-platform porting.
Projects in hybrid Development Mode
<DrawingsurfacebackgroundgridX: Name= "Drawingsurfacebackgroundgrid"><DrawingsurfaceX: Name= "Drawingsurface"/></Drawingsurfacebackgroundgrid>
Use Windows phone8 features in direct development
Link: http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj207052 (V = vs.105). aspx
Direct3d with XAML marble maze
Download instance code
The above is an explanation of the Mixed Development Mode of local code. We hope to see more excellent game works on Windows Phone 8 through your efforts.
This article is an update of 13 feature series required to be updated to WP8. We hope this series will bring some development convenience to Windows Phone 8 developers.
At the same time, you are welcome to communicate with me or @ Wang Bo _ nick on Sina Weibo.