// 阶乘体系月亮太阳旋转原理.cpp : 定义应用程序的入口点。
//
#include "stdafx.h"
#include "阶乘体系月亮太阳旋转原理.h"
#include<d3d9.h>
#include<d3dx9.h>
#include<Windows.h>
LPDIRECT3D9 g_pD3D = NULL ;
LPDIRECT3DDEVICE9 g_pd3dDevice = NULL ;
LPDIRECT3DVERTEXBUFFER9 g_pVB = NULL ;
LPDIRECT3DINDEXBUFFER9 g_pIB = NULL ;
D3DXMATRIXA16 g_matTMParent ;
D3DXMATRIXA16 g_matRParent ;
D3DXMATRIXA16 g_matTMChild ;
D3DXMATRIXA16 g_matRChild ;
#pragma comment(lib, "d3d9.lib")
#pragma comment(lib, "d3dx9.lib")
struct CUSTOMVERTEX
{
FLOAT x,y,z;
DWORD color;
};
#define D3DFVF_CUSTOMVERTEX (D3DFVF_XYZ |D3DFVF_DIFFUSE)
struct MYINDEX
{
WORD _0,_1,_2;
};
HRESULT InitD3D (HWND hWnd )
{
//创建D3D对象
if(NULL == ( g_pD3D =Direct3DCreate9 ( D3D_SDK_VERSION ) ))
return E_FAIL;
//创建设备的结构体
D3DPRESENT_PARAMETERS d3dpp;
ZeroMemory(&d3dpp ,sizeof(d3dpp));
d3dpp.Windowed = TRUE;
d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
d3dpp.BackBufferFormat = D3DFMT_UNKNOWN;
d3dpp.EnableAutoDepthStencil = TRUE;
d3dpp.AutoDepthStencilFormat = D3DFMT_D16;