0001: //-----------------------------------------------------------------------------
0002: // File: main.h
0003: //
0004: // Desc: Header file main sample app
0005: //-----------------------------------------------------------------------------
0006: #pragma once
0007: 
0008: 
0009: 
0010: 
0011: //-----------------------------------------------------------------------------
0012: // Defines, and constants
0013: //-----------------------------------------------------------------------------
0014: // TODO: change "DirectX AppWizard Apps" to your name or the company name
0015: #define DXAPP_KEY        TEXT("Software\\DirectX AppWizard Apps\\main")
0016: 
0017: // Struct to store the current input state
0018: struct UserInput
0019: {
0020:     // TODO: change as needed
0021:     BOOL bRotateUp;
0022:     BOOL bRotateDown;
0023:     BOOL bRotateLeft;
0024:     BOOL bRotateRight;
0025:     BOOL bZ;
0026:     BOOL bX;
0027: };
0028: 
0029: 
0030: 
0031: 
0032: //-----------------------------------------------------------------------------
0033: // Name: class CMyD3DApplication
0034: // Desc: Application class. The base class (CD3DApplication) provides the 
0035: //       generic functionality needed in all Direct3D samples. CMyD3DApplication 
0036: //       adds functionality specific to this sample program.
0037: //-----------------------------------------------------------------------------
0038: class CMyD3DApplication : public CD3DApplication
0039: {
0040:     BOOL                            m_bDMap;    // ディスプレースメントマップをサポートしているか
0041:     FLOAT                           m_degree;   // 変化させる量
0042:     CD3DMesh                        *m_pMesh;   // 表示するメッシュ
0043:     LPDIRECT3DVERTEXDECLARATION9    m_pDecl;    // 頂点宣言
0044:     LPDIRECT3DTEXTURE9              m_pDispMap; // ディスプレースメントマップのオブジェクト
0045:     LPD3DXEFFECT                    m_pEffect;  // シェーダが書かれたエフェクト
0046: 
0047:     D3DXMATRIX              m_mWorld;
0048:     D3DXMATRIX              m_mView;
0049:     D3DXMATRIX              m_mProj;
0050:     D3DXVECTOR4             m_LighPos;          // 光源の方向
0051: 
0052:     BOOL                    m_bLoadingApp;      // TRUE, if the app is loading
0053:     CD3DFont*               m_pFont;            // Font for drawing text
0054:     UserInput               m_UserInput;        // Struct for storing user input 
0055: 
0056:     FLOAT                   m_fWorldRotX;       // World rotation state X-axis
0057:     FLOAT                   m_fWorldRotY;       // World rotation state Y-axis
0058: 
0059: protected:
0060:     virtual HRESULT OneTimeSceneInit();
0061:     virtual HRESULT InitDeviceObjects();
0062:     virtual HRESULT RestoreDeviceObjects();
0063:     virtual HRESULT InvalidateDeviceObjects();
0064:     virtual HRESULT DeleteDeviceObjects();
0065:     virtual HRESULT Render();
0066:     virtual HRESULT FrameMove();
0067:     virtual HRESULT FinalCleanup();
0068:     virtual HRESULT ConfirmDevice( D3DCAPS9*, DWORD, D3DFORMAT );
0069: 
0070:     HRESULT RenderText();
0071: 
0072:     void    UpdateInput( UserInput* pUserInput );
0073: public:
0074:     LRESULT MsgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam );
0075:     CMyD3DApplication();
0076:     virtual ~CMyD3DApplication();
0077: };
0078: 
0079: