DirectXApp.h
资源名称:DXGuide.zip [点击查看]
上传用户:wymy58
上传日期:2007-01-07
资源大小:2086k
文件大小:3k
源码类别:
DirextX编程
开发平台:
Visual C++
- // Copyright (C) 1998-1999 DXGuide. All Rights Reserved.
- // File: DirectXApp.h
- #ifndef _DIRECTXAPP__H
- #define _DIRECTXAPP__H
- #if _MSC_VER >= 1000
- #pragma once
- #endif // _MSC_VER >= 1000
- #include "DirectDraw.h"
- #include "DirectInput.h"
- #include "DirectSound.h"
- #include "DirectMusic.h"
- class CD3DViewport;
- class CDDSurface;
- class CPackFileManager;
- class CDXGUIManager;
- class CDirectXApp : public CWinApp
- {
- friend class CDirectXFrame;
- #ifdef _LOG_HTML
- friend class CDirectX;
- #endif // _LOG_HTML
- public:
- // Flags for DDInit
- enum DXAppInitFlag
- {
- DXAPPIF_DD = 0x00000001L,
- DXAPPIF_D3DIM = 0x00000002L,
- DXAPPIF_DI = 0x00000010L, // Use DirectInput
- DXAPPIF_DS = 0x00000100L, // Use DirectSound
- DXAPPIF_DMUS = 0x00001000L, // Use DirectMusic
- DXAPPIF_GUIMANAGER = 0x00010000L, // Use DXGUIManager
- DXAPPIF_NO_SWITCH = 0x00100000L, // Switch display mode ?
- DXAPPIF_HIGHPRIORITY = 0x00200000L, // Set Priority ?
- DXAPPIF_SHOWSTATDLG = 0x00400000L, // Show Statistic Dialog ?
- };
- public:
- CDirectXApp(void);
- virtual ~CDirectXApp();
- public:
- virtual bool GetDXInitSettings(void);
- virtual bool InitDXObjects(void) = 0;
- virtual bool DestroyDXObjects(void);
- virtual bool UpdateFrame(void);
- virtual void OnActive(bool bActivate);
- protected:
- bool m_bReinitialize;
- public:
- bool SwitchDisplayMode(void);
- bool Reset(void);
- public:
- bool IsFullScreen(void) const;
- void SetFullScreen(bool bFullScreen);
- CDDDevice* GetFirstDDDevice(void) const;
- CD3DDevice* GetFirstD3DDevice(void) const;
- protected:
- virtual LPCTSTR GetClassName(void) const;
- virtual bool IsFirstInstance(void);
- public:
- void SetPackFileName(LPCTSTR lpszPackFileName,
- LPCTSTR lpszGUIPackFileName);
- protected:
- virtual double CalcFPS(DWORD& dwTimeSpan);
- protected:
- DWORD m_dwAppInitFlags;
- DWORD m_dwDDInitFlags;
- DWORD m_dwDSInitFlags;
- DWORD m_dwDIInitFlags;
- DWORD m_dwGUIManagerInitFlags;
- bool m_bActive;
- CDirectDraw* m_pDirectDraw;
- CDirectInput* m_pDirectInput;
- CDirectSound* m_pDirectSound;
- CDirectMusic* m_pDirectMusic;
- CDXGUIManager* m_pGUIManager;
- DWORD m_dwFrames;
- DWORD m_dwTimeStart;
- CString m_strPackFileName;
- CString m_strGUIPackFileName;
- CPackFileManager* m_pPackFileManager;
- protected:
- LPCTSTR m_lpcszUniqueClass;
- bool m_bClassRegistered;
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CDirectXApp)
- public:
- virtual BOOL InitInstance();
- virtual BOOL OnIdle(LONG lCount);
- virtual int ExitInstance();
- //}}AFX_VIRTUAL
- // Implementation
- //{{AFX_MSG(CDirectXApp)
- afx_msg void OnAppAbout();
- // NOTE - the ClassWizard will add and remove member functions here.
- // DO NOT EDIT what you see in these blocks of generated code !
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- };
- #include "DirectXApp.inl"
- #endif // _DIRECTXAPP__H