一个完整的2D滚屏游戏示例

源代码在线查看: wave.h

软件大小: 3212 K
上传用户: Fiona1207
关键词:
下载地址: 免注册下载 普通下载 VIP

相关代码

				//-----------------------------------------------------------------
				// Wave Object
				// C++ Header - Wave.h
				//-----------------------------------------------------------------
				
				#ifndef __WAVE_H__
				#define __WAVE_H__
				
				//-----------------------------------------------------------------
				// Inclusions
				//-----------------------------------------------------------------
				#include 
				
				//-----------------------------------------------------------------
				// CWave Class - Wave Object
				//-----------------------------------------------------------------
				class CWave {
				    // Public Constructor(s)/Destructor
				public:
				            CWave();
				            CWave(const char* pszFileName);
				            CWave(UINT uiResID, HMODULE hmod);
				    virtual ~CWave();
				
				  // Public Methods
				public:
				    BOOL    Create(const char* pszFileName);
				    BOOL    Create(UINT uiResID, HMODULE hmod);
				    BOOL    IsValid() const { return (m_pImageData ? TRUE :
				                FALSE); };
				    BOOL    Play(BOOL bAsync = TRUE, BOOL bLooped = FALSE) const;
				    BOOL    GetFormat(WAVEFORMATEX& wfFormat) const;
				    DWORD   GetDataLen() const;
				    DWORD   GetData(BYTE*& pWaveData, DWORD dwMaxToCopy) const;
				
				    // Protected Methods
				protected:
				    BOOL    Free();
				
				    // Private Data
				private:
				    BYTE* m_pImageData;
				    DWORD m_dwImageLen;
				    BOOL  m_bResource;
				};
				
				#endif
							

相关资源