0001:
0002:
0003:
0004:
0005:
0006: #pragma once
0007: #ifndef __AFXWIN_H__
0008: #error include 'stdafx.h' before including this file
0009: #endif
0010:
0011:
0012:
0013:
0014:
0015:
0016:
0017:
0018: #define DXAPP_KEY TEXT("Software\\DirectX AppWizard Apps\\CheckDeviceFormatViewer")
0019:
0020:
0021: struct UserInput
0022: {
0023:
0024: BOOL bRotateUp;
0025: BOOL bRotateDown;
0026: BOOL bRotateLeft;
0027: BOOL bRotateRight;
0028: };
0029:
0030:
0031: typedef struct {
0032: D3DFORMAT val;
0033: char text[64];
0034: }MyFormat;
0035:
0036:
0037: typedef struct {
0038: DWORD val;
0039: char text[64];
0040: }MyUsage;
0041:
0042:
0043:
0044:
0045:
0046:
0047:
0048:
0049: class CAppForm : public CFormView, public CD3DApplication
0050: {
0051: public:
0052: BOOL m_bLoadingApp;
0053: ID3DXFont* m_pFont;
0054: UserInput m_UserInput;
0055:
0056: FLOAT m_fWorldRotX;
0057: FLOAT m_fWorldRotY;
0058:
0059: static const MyFormat *m_Formats;
0060: int m_nFormat;
0061: static const MyUsage *m_Usages;
0062:
0063: BOOL *m_pbResult;
0064:
0065: private:
0066: HWND m_hwndRenderWindow;
0067: HWND m_hwndRenderFullScreen;
0068: HWND m_hWndTopLevelParent;
0069:
0070: virtual HRESULT ConfirmDevice( D3DCAPS9*,DWORD,D3DFORMAT );
0071: virtual HRESULT OneTimeSceneInit();
0072: virtual HRESULT InitDeviceObjects();
0073: virtual HRESULT RestoreDeviceObjects();
0074: virtual HRESULT FrameMove();
0075: virtual HRESULT Render();
0076: virtual HRESULT InvalidateDeviceObjects();
0077: virtual HRESULT DeleteDeviceObjects();
0078: virtual HRESULT FinalCleanup();
0079: virtual HRESULT AdjustWindowForChange();
0080:
0081: HRESULT RenderText();
0082:
0083: void UpdateInput( UserInput* pUserInput );
0084: VOID ReadSettings();
0085: VOID WriteSettings();
0086:
0087: VOID UpdateUIForDeviceCapabilites();
0088:
0089: protected:
0090: DECLARE_DYNCREATE(CAppForm)
0091:
0092: CAppForm();
0093: virtual ~CAppForm();
0094:
0095: public:
0096: BOOL IsReady() { return m_bActive; }
0097: TCHAR* PstrFrameStats() { return m_strFrameStats; }
0098: VOID RenderScene() { Render3DEnvironment(); }
0099: HRESULT CheckForLostFullscreen();
0100:
0101:
0102: enum { IDD = IDD_FORMVIEW };
0103:
0104:
0105:
0106: virtual void OnInitialUpdate();
0107: protected:
0108: virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
0109: virtual void DoDataExchange(CDataExchange* pDX);
0110:
0111:
0112: public:
0113:
0114: afx_msg void OnToggleFullScreen();
0115: afx_msg void OnChangeDevice();
0116:
0117: DECLARE_MESSAGE_MAP()
0118:
0119: BOOL m_bCheckRenderTarget;
0120: BOOL m_bCheckDepthStencil;
0121: BOOL m_bCheckDynamic;
0122: BOOL m_bCheckAutoGenMipmap;
0123: BOOL m_bCheckDMap;
0124: int m_iResourceType;
0125: afx_msg void OnBnClickedCheckRendertarget();
0126: afx_msg void OnBnClickedButton1();
0127: afx_msg void OnBnClickedButtonCheckDeviceFormat();
0128: };
0129:
0130:
0131:
0132:
0133:
0134:
0135:
0136:
0137: class CAppDoc : public CDocument
0138: {
0139: protected:
0140: DECLARE_DYNCREATE(CAppDoc)
0141:
0142:
0143:
0144:
0145: public:
0146:
0147:
0148:
0149:
0150:
0151:
0152:
0153: DECLARE_MESSAGE_MAP()
0154: };
0155:
0156:
0157:
0158:
0159:
0160:
0161:
0162:
0163: class CAppFrameWnd : public CFrameWnd
0164: {
0165: protected:
0166: DECLARE_DYNCREATE(CAppFrameWnd)
0167: public:
0168:
0169:
0170: public:
0171: virtual BOOL PreCreateWindow( CREATESTRUCT& cs );
0172: virtual BOOL LoadFrame(UINT nIDResource, DWORD dwDefaultStyle = WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, CWnd* pParentWnd = NULL, CCreateContext* pContext = NULL);
0173:
0174:
0175: protected:
0176:
0177: afx_msg void OnChangeDevice();
0178:
0179: DECLARE_MESSAGE_MAP()
0180: };
0181:
0182:
0183:
0184:
0185:
0186:
0187:
0188:
0189: class CApp : public CWinApp
0190: {
0191: public:
0192:
0193:
0194:
0195:
0196: public:
0197: virtual BOOL InitInstance();
0198: virtual BOOL OnIdle( LONG );
0199:
0200:
0201:
0202:
0203:
0204: DECLARE_MESSAGE_MAP()
0205: };
0206:
0207:
0208:
0209:
0210: