0001: //-----------------------------------------------------------------------------
0002: // File: sample.h
0003: //
0004: // Desc: Header file sample sample app
0005: //-----------------------------------------------------------------------------
0006: #ifndef AFX_SAMPLE_H__67868186_71EA_417C_BA06_171CFBE5A34C__INCLUDED_
0007: #define AFX_SAMPLE_H__67868186_71EA_417C_BA06_171CFBE5A34C__INCLUDED_
0008: 
0009: 
0010: 
0011: 
0012: //-----------------------------------------------------------------------------
0013: // Defines, and constants
0014: //-----------------------------------------------------------------------------
0015: // TODO: change "DirectX AppWizard Apps" to your name or the company name
0016: #define DXAPP_KEY        TEXT("Software\\DirectX AppWizard Apps\\sample")
0017: 
0018: // Struct to store the current input state
0019: struct UserInput
0020: {
0021:     // TODO: change as needed
0022:     BOOL bRotateUp;
0023:     BOOL bRotateDown;
0024:     BOOL bRotateLeft;
0025:     BOOL bRotateRight;
0026: };
0027: 
0028: 
0029: 
0030: 
0031: //-----------------------------------------------------------------------------
0032: // Name: class CMyD3DApplication
0033: // Desc: Application class. The base class (CD3DApplication) provides the 
0034: //       generic functionality needed in all Direct3D samples. CMyD3DApplication 
0035: //       adds functionality specific to this sample program.
0036: //-----------------------------------------------------------------------------
0037: class CMyD3DApplication : public CD3DApplication
0038: {
0039:     BOOL                    m_bLoadingApp;          // TRUE, if the app is loading
0040:     CD3DFont*               m_pFont;                // Font for drawing text
0041:     ID3DXMesh*              m_pD3DXMesh;            // D3DX mesh to store teapot
0042: 
0043:     UserInput               m_UserInput;            // Struct for storing user input 
0044: 
0045:     FLOAT                   m_fWorldRotX;           // World rotation state X-axis
0046:     FLOAT                   m_fWorldRotY;           // World rotation state Y-axis
0047: 
0048: protected:
0049:     HRESULT OneTimeSceneInit();
0050:     HRESULT InitDeviceObjects();
0051:     HRESULT RestoreDeviceObjects();
0052:     HRESULT InvalidateDeviceObjects();
0053:     HRESULT DeleteDeviceObjects();
0054:     HRESULT Render();
0055:     HRESULT FrameMove();
0056:     HRESULT FinalCleanup();
0057:     HRESULT ConfirmDevice( D3DCAPS8*, DWORD, D3DFORMAT );
0058: 
0059:     HRESULT RenderText();
0060: 
0061:     void    UpdateInput( UserInput* pUserInput );
0062: 
0063:     VOID    ReadSettings();
0064:     VOID    WriteSettings();
0065: 
0066: public:
0067:     LRESULT MsgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam );
0068:     CMyD3DApplication();
0069: };
0070: 
0071: 
0072: #endif // !defined(AFX_SAMPLE_H__67868186_71EA_417C_BA06_171CFBE5A34C__INCLUDED_)
0073: