Start now, DirectX9.0's post. The first chapter, the initialization of DirectX.
1, project preparation
Need to insert .lib file
D3DXOF.LIB DXGUID.LIB D3DX9DT.LIB D3D9.LIB Winmm.lib
A total of 5
2 code composition
1 project file, 2 head files, 2 .cpp files. Head file
STDAFX.H
The top-level file of the project.
D3DSetup9.h
CD3DSETUP9 definition file
.cpp file:
Main.cpp
Winmain () function and windproc () functions. In short, just call CD3DSETUP9 class
D3DSETUP.CPP
Member function of the CD3DSetup class implements file, initialization, and render (), etc.
3 detailed implementation
//stdafx.h
#pragma overce # include
//d3dsetup9.h
#include "stdafx.h" #include
HRESULT Apploop (); // public: cd3dsetup9 (); ~ cd3dsetup9 (); HRESULT RUN (Hinstance Hinst, Char Szwinname [], int Width, int Height, Bool bwin; ///////
LRESULT MSGPROC (HWND HWND, UINT UMSG, WPARAM WPARAM, LPARAM LPARAM); HRESULT RENDER (); // HRESULT CLEANUP (); ///};
........ (Continu ..