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

📄 gsengine.h

📁 连连看这个游戏都玩过吧
💻 H
📖 第 1 页 / 共 2 页
字号:
					  FLOAT fAlpha	= 1.0f,					
					  FLOAT fAngle	= 0.0f,					
					  D3DCOLOR cMix = D3DRGBA(0.5f, 0.5f, 0.5f, 1.0f));	
	HRESULT Render_PaintFast(int xDest, int yDest,
					  CGsTexture* pTexture,
					  FLOAT fZValue	= 1.0f,
					  FLOAT fScaleW = 1.0f,			
					  FLOAT fScaleH = 1.0f,					
					  FLOAT fAlpha	= 1.0f,					
					  D3DCOLOR cMix = D3DRGBA(0.5f, 0.5f, 0.5f, 1.0f));
	HRESULT Render_PaintRect(int xDest, int yDest,
					  CGsTexture* pTexture,
					  FLOAT fZValue	= 1.0f,
					  GRECT *rcSrc	= NULL,
					  GPOINT*basePoint =NULL,
					  FLOAT fScaleW = 1.0f,			
					  FLOAT fScaleH = 1.0f,					
					  FLOAT fAlpha	= 1.0f,					
					  FLOAT fAngle	= 0.0f,					
					  D3DCOLOR cMix = D3DRGBA(0.5f, 0.5f, 0.5f, 1.0f));	
	HRESULT Render_PaintFastRect(int xDest, int yDest,
					  CGsTexture* pTexture,
					  FLOAT fZValue	= 1.0f,
					  GRECT *rcSrc	= NULL,
					  GPOINT*basePoint =NULL,
					  FLOAT fScaleW = 1.0f,			
					  FLOAT fScaleH = 1.0f,					
					  FLOAT fAlpha	= 1.0f,					
					  D3DCOLOR cMix = D3DRGBA(0.5f, 0.5f, 0.5f, 1.0f));
	HRESULT Render_ClipPaint(int xDest, int yDest,
					  GRECT	rcClip,
					  CGsTexture* pTexture,
					  FLOAT fZValue	= 1.0f,
					  FLOAT fScaleW = 1.0f,			
					  FLOAT fScaleH = 1.0f,					
					  FLOAT fAlpha	= 1.0f,					
					  FLOAT fAngle	= 0.0f,					
					  D3DCOLOR cMix = D3DRGBA(0.5f, 0.5f, 0.5f, 1.0f));	
	HRESULT Render_ClipPaintFast(int xDest, int yDest,
					  GRECT	rcClip,
					  CGsTexture* pTexture,
					  FLOAT fZValue	= 1.0f,
					  FLOAT fScaleW = 1.0f,			
					  FLOAT fScaleH = 1.0f,					
					  FLOAT fAlpha	= 1.0f,					
					  D3DCOLOR cMix = D3DRGBA(0.5f, 0.5f, 0.5f, 1.0f));

	///
	HRESULT Render_PaintFrame(int xDest, int yDest,
						  CGsTexture* pTexture,
						  BOOL		bSolid			= false,
						  D3DCOLOR	crTopLeft		= D3DRGBA(1.0f, 1.0f, 1.0f, 1.0f),
						  D3DCOLOR	crTopRight		= D3DRGBA(1.0f, 1.0f, 1.0f, 1.0f),
						  D3DCOLOR	crBottomLeft	= D3DRGBA(1.0f, 1.0f, 1.0f, 1.0f),
						  D3DCOLOR	crBottomRight	= D3DRGBA(1.0f, 1.0f, 1.0f, 1.0f),
						  FLOAT fZValue	= 1.0f,
						  FLOAT fScaleW = 1.0f,			
						  FLOAT fScaleH = 1.0f,					
						  FLOAT fAlpha	= 1.0f,					
						  FLOAT fAngle	= 0.0f,					
						  D3DCOLOR cMix = D3DRGBA(0.5f, 0.5f, 0.5f, 1.0f));	
	HRESULT Render_PaintFastFrame(int xDest, int yDest,
						  CGsTexture* pTexture,
						  BOOL		bSolid			= false,
						  D3DCOLOR	crTopLeft		= D3DRGBA(1.0f, 1.0f, 1.0f, 1.0f),
						  D3DCOLOR	crTopRight		= D3DRGBA(1.0f, 1.0f, 1.0f, 1.0f),
						  D3DCOLOR	crBottomLeft	= D3DRGBA(1.0f, 1.0f, 1.0f, 1.0f),
						  D3DCOLOR	crBottomRight	= D3DRGBA(1.0f, 1.0f, 1.0f, 1.0f),
						  FLOAT fZValue	= 1.0f,
						  FLOAT fScaleW = 1.0f,			
						  FLOAT fScaleH = 1.0f,					
						  FLOAT fAlpha	= 1.0f,					
						  D3DCOLOR cMix = D3DRGBA(0.5f, 0.5f, 0.5f, 1.0f));
	HRESULT Render_ClipPaintFrame(int xDest, int yDest,
						  GRECT	rcClip,
						  CGsTexture* pTexture,
						  BOOL		bSolid			= false,
						  D3DCOLOR	crTopLeft		= D3DRGBA(1.0f, 1.0f, 1.0f, 1.0f),
						  D3DCOLOR	crTopRight		= D3DRGBA(1.0f, 1.0f, 1.0f, 1.0f),
						  D3DCOLOR	crBottomLeft	= D3DRGBA(1.0f, 1.0f, 1.0f, 1.0f),
						  D3DCOLOR	crBottomRight	= D3DRGBA(1.0f, 1.0f, 1.0f, 1.0f),
						  FLOAT fZValue	= 1.0f,
						  FLOAT fScaleW = 1.0f,			
						  FLOAT fScaleH = 1.0f,					
						  FLOAT fAlpha	= 1.0f,					
						  FLOAT fAngle	= 0.0f,					
						  D3DCOLOR cMix = D3DRGBA(0.5f, 0.5f, 0.5f, 1.0f));	
	HRESULT Render_ClipPaintFastFrame(int xDest, int yDest,
						  GRECT	rcClip,
						  CGsTexture* pTexture,
						  BOOL		bSolid			= false,
						  D3DCOLOR	crTopLeft		= D3DRGBA(1.0f, 1.0f, 1.0f, 1.0f),
						  D3DCOLOR	crTopRight		= D3DRGBA(1.0f, 1.0f, 1.0f, 1.0f),
						  D3DCOLOR	crBottomLeft	= D3DRGBA(1.0f, 1.0f, 1.0f, 1.0f),
						  D3DCOLOR	crBottomRight	= D3DRGBA(1.0f, 1.0f, 1.0f, 1.0f),
						  FLOAT fZValue	= 1.0f,
						  FLOAT fScaleW = 1.0f,			
						  FLOAT fScaleH = 1.0f,					
						  FLOAT fAlpha	= 1.0f,					
						  D3DCOLOR cMix = D3DRGBA(0.5f, 0.5f, 0.5f, 1.0f));



	//扩展
	HRESULT Render_PaintEx(int xDest, int yDest,
						  CGsTexture* pTexture,
						  D3DCOLOR	crTopLeft		= D3DRGBA(1.0f, 1.0f, 1.0f, 1.0f),
						  D3DCOLOR	crTopRight		= D3DRGBA(1.0f, 1.0f, 1.0f, 1.0f),
						  D3DCOLOR	crBottomLeft	= D3DRGBA(1.0f, 1.0f, 1.0f, 1.0f),
						  D3DCOLOR	crBottomRight	= D3DRGBA(1.0f, 1.0f, 1.0f, 1.0f),
						  FLOAT fZValue	= 1.0f,
						  FLOAT fScaleW = 1.0f,			
						  FLOAT fScaleH = 1.0f,					
						  FLOAT fAngle	= 0.0f					
						  );	
	HRESULT Render_PaintFastEx(int xDest, int yDest,
						  CGsTexture* pTexture,
						  D3DCOLOR	crTopLeft		= D3DRGBA(1.0f, 1.0f, 1.0f, 1.0f),
						  D3DCOLOR	crTopRight		= D3DRGBA(1.0f, 1.0f, 1.0f, 1.0f),
						  D3DCOLOR	crBottomLeft	= D3DRGBA(1.0f, 1.0f, 1.0f, 1.0f),
						  D3DCOLOR	crBottomRight	= D3DRGBA(1.0f, 1.0f, 1.0f, 1.0f),
						  FLOAT fZValue	= 1.0f,
						  FLOAT fScaleW = 1.0f,			
						  FLOAT fScaleH = 1.0f					
						  );
	HRESULT Render_ClipPaintEx(int xDest, int yDest,
						  GRECT	rcClip,
						  CGsTexture* pTexture,
						  D3DCOLOR	crTopLeft		= D3DRGBA(1.0f, 1.0f, 1.0f, 1.0f),
						  D3DCOLOR	crTopRight		= D3DRGBA(1.0f, 1.0f, 1.0f, 1.0f),
						  D3DCOLOR	crBottomLeft	= D3DRGBA(1.0f, 1.0f, 1.0f, 1.0f),
						  D3DCOLOR	crBottomRight	= D3DRGBA(1.0f, 1.0f, 1.0f, 1.0f),
						  FLOAT fZValue	= 1.0f,
						  FLOAT fScaleW = 1.0f,			
						  FLOAT fScaleH = 1.0f,					
						  FLOAT fAngle	= 0.0f					
						  );	
	HRESULT Render_ClipPaintFastEx(int xDest, int yDest,
						  GRECT	rcClip,
						  CGsTexture* pTexture,
						  D3DCOLOR	crTopLeft		= D3DRGBA(1.0f, 1.0f, 1.0f, 1.0f),
						  D3DCOLOR	crTopRight		= D3DRGBA(1.0f, 1.0f, 1.0f, 1.0f),
						  D3DCOLOR	crBottomLeft	= D3DRGBA(1.0f, 1.0f, 1.0f, 1.0f),
						  D3DCOLOR	crBottomRight	= D3DRGBA(1.0f, 1.0f, 1.0f, 1.0f),
						  FLOAT fZValue	= 1.0f,
						  FLOAT fScaleW = 1.0f,			
						  FLOAT fScaleH = 1.0f					
						  );




	HRESULT DarkenScene(FLOAT fLight = 1.0f);


	HRESULT ChangeEngineMode();


    HRESULT DestroyEngine();
	HRESULT DestroyObjects();

	// Functoins to manage surface
	virtual	HRESULT						RestoreSource();
	virtual	HRESULT						ReleaseSource();
	//HRESULT						DismissAllDxSurface();
	//HRESULT						EraseAllDxSurface();
	//HRESULT						EraseDxSurface(char* szName);


	HRESULT PrepareForRender();

	HRESULT	InitEngine( HWND hWnd, int width=0, int height=0, BOOL bResize=false);


	CGsEngine();
	virtual ~CGsEngine();
protected:
	//重载成员
	RSTYLE						m_RenderStyle;
	BOOL						m_isSingleStep;
	BOOL						m_isViewportUse;			// 决定是否操作视口
	BOOL						m_isWantZBuffer;			// 决定是否使用Z缓冲
	BOOL						m_isOperating;				// 操作开关,为真时全屏模式可显示菜单和窗口
	BOOL						m_enableBackgroundActive;	// 后台工作开关
	DWORD						m_dwStepRate;				// 单步模式的步速,单位1ms

//	BOOL						m_bUseHWBlt;				// 是否使用硬件功能进行页面位块传送
	
	WORD						idr_popup_menu;			// Popup menu
	WORD						idr_command_updatemode;	// Command to toggle fullscreen mode
	WORD						idr_command_auto;		// Command to toggle frame animation
	WORD						idr_command_step;		// Command to single step frame animation
	WORD						idr_command_pause;		// Command to pause
	WORD						idr_command_operate;	// command to operate mode, can see window and windows
	WORD						idr_choose_mode;		// Choose display mode


	virtual	BOOL	OnUpdate();//					    { return FALSE; }
	virtual	BOOL	OnUpdateSecond();//					    { return FALSE; }
	virtual	BOOL	OnUpdateMinute();//					    { return FALSE; }
	virtual	HRESULT OnRender();//						{ return S_OK; }
	virtual HRESULT OnDraw(CGsSurface* pBackSurface);
	virtual HRESULT OnCreate()						{ return S_OK; }
	virtual HRESULT OnInitDevice();
	//virtual HRESULT OnInitDevice()					{ return S_OK; }
	virtual HRESULT OnCleanDevice()					{ return S_OK; }
	virtual HRESULT OnFinalCleanup()				{ return S_OK; }

	virtual	VOID	OnSizeChanged()					{ return; }
	virtual	VOID	OnDismiss();

	virtual	LRESULT	MsgProc( UINT uMsg, WPARAM wParam, LPARAM lParam );
	virtual	VOID	Pause( BOOL bPause );

	virtual ID	OnMouseMove( UINT nFlags );		//鼠标消息使用windows消息,键盘使用direct input?
	virtual ID	OnMouseWheel( UINT nFlags, short zDelta );
	virtual ID	OnLButtonDown( UINT nFlags );
	virtual ID	OnLButtonUp( UINT nFlags );
	virtual ID	OnLButtonDbClk( UINT nFlags )	;
	virtual ID	OnRButtonDown( UINT nFlags );
	virtual ID	OnRButtonUp( UINT nFlags );
	virtual ID	OnRButtonDbClk( UINT nFlags );
	virtual ID	OnChar( UINT nChar, UINT nRepCnt, UINT nFlags );
	virtual ID	OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
	virtual ID	OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);

 	virtual HRESULT BuildParticles();
	VOID	CleanupParticles();

   // View control functions (for stereo-enabled applications)
    D3DMATRIX m_matLeftView;
    D3DMATRIX m_matRightView;
    D3DMATRIX m_matView;
    VOID    SetEngineLeftViewMatrix( D3DMATRIX mat )  { m_matLeftView  = mat; }
    VOID    SetEngineRightViewMatrix( D3DMATRIX mat ) { m_matRightView = mat; }
    VOID    SetEngineViewMatrix( D3DMATRIX mat )      { m_matView      = mat; }
    VOID    SetViewParams( D3DVECTOR* vEyePt, D3DVECTOR* vLookatPt,
                           D3DVECTOR* vUpVec, FLOAT fEyeDistance );




private:
    // Internal functions for the framework class
	BOOL	 _UpdateEngine();
	HRESULT _RenderEngine();
	HRESULT _CreateSoundSystem();
    HRESULT _CreateZBuffer();
    HRESULT _CreateFullscreenBuffers( DDSURFACEDESC2* );
    HRESULT _CreateWindowedBuffers( DWORD dwRenderWidth = 0, DWORD dwRenderHeight = 0, BOOL bResize=false );
    HRESULT _Create3DDevice();
	HRESULT	_CreateDriver();
	HRESULT _CreateDevice(int width=0, int height=0, BOOL bResize=false);
	HRESULT	_FsFlip();
	VOID	_UpdateMenu(HMENU hMenu);

};




#endif // !defined(AFX_GSENGINE_H__96E2A6AA_E292_4482_A719_A0CB7AE21B16__INCLUDED_)

⌨️ 快捷键说明

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