⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 d3dbase.h

📁 使用shader语言在vs阶段编写光照效果的演示程序及全部源代码
💻 H
字号:
/****



应用程序框架

潘李亮 2006-1-14

****/

#ifndef __D3DBase_h__
#define __D3DBase_h__
#include <d3d9.h>
#include <d3dx9.h>

class CD3DApplication
{
protected:
	IDirect3D9*             m_pD3D9Object;
	IDirect3DDevice9*       m_pD3DDevice;
	HWND                    m_hMainWnd;
	int                     m_Width ;
	int                     m_Height;
	bool                    m_isFullScreen;

	D3DFORMAT               m_BackBufferFormat;
	D3DFORMAT               m_DepthStencilFormat;
	UINT                    m_FullScreen_RefreshRateInHz;

	D3DXMATRIX              m_WorldMatrix;
	D3DXMATRIX              m_ViewMatrix;
	D3DXMATRIX              m_ProjMatrix;

	static CD3DApplication* m_pApp;
	static LONG CALLBACK windowProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam);
public:
	static CD3DApplication* getApp()
	{
         return m_pApp;
	}

	IDirect3DDevice9*   getDevice()
	{
		return m_pD3DDevice;
	}
    CD3DApplication();
	bool create(int Width,int height, const char* appTitle, bool fullScreen = false);
	bool createdevice(int bufferWidht, int bufferHeight);
	void destoryApp();
	bool loop();


	virtual void onRender(long passedTime) = 0;
	virtual LONG onWndMessage(UINT msg,WPARAM wParam,LPARAM lParam) = 0;
};

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -