Game Accessibility Library logo SourceForge.net Logo
Game Accessibility Suite: CAT/CATOverlayDirect3D9.h Source File

CATOverlayDirect3D9.h

Go to the documentation of this file.
00001 /// \file  CATOverlayDirect3D9.h
00002 /// \brief Direct3D function interception
00003 /// \ingroup CAT
00004 ///
00005 /// Copyright (c) 2007-2008 by Michael Ellison.
00006 /// See COPYING.txt for the \ref gaslicense License (MIT License).
00007 ///
00008 // $Author: mikeellison $
00009 // $Date: 2008-01-29 07:01:23 -0600 (Tue, 29 Jan 2008) $
00010 // $Revision:   $
00011 // $NoKeywords: $
00012 
00013 #ifndef _CATOverlayDirect3D_H_
00014 #define _CATOverlayDirect3D_H_
00015 
00016 #include "CATOverlay.h"
00017 #ifdef CAT_CONFIG_WIN32
00018 
00019 struct IDirect3DDevice9;
00020 struct _D3DPRESENT_PARAMETERS_;
00021 struct IDirect3DTexture9;
00022 struct ID3DXSprite;
00023 
00024 /// \class CATOverlayDirect3D9
00025 /// \brief Direct3D function interception
00026 /// \ingroup CAT
00027 class CATOverlayDirect3D9 : public CATOverlay
00028 {
00029     public:
00030         CATOverlayDirect3D9();
00031         virtual ~CATOverlayDirect3D9();
00032 
00033         CATResult HookFunctions();
00034 
00035     protected:        
00036         static void DeviceLost( CATHOOK* hookInst, IDirect3DDevice9* device);
00037         static void DeviceOk  ( CATHOOK* hookInst, IDirect3DDevice9* device);
00038 
00039         void DrawToScene(    IDirect3DDevice9*           device);
00040         void Reset(          IDirect3DDevice9*           device,
00041                              _D3DPRESENT_PARAMETERS_*    presParams);
00042 
00043         static CATINTERCEPT_COM_TABLE_ENTRY kDirect3DDeviceInterceptTable9[];    ///< COM functions for IDirect3DDevice9 
00044                                                                                  ///< to hook.
00045 
00046         static void     OnReset9(       CATHOOK*                    hookInst,
00047                                         IDirect3DDevice9*           device,
00048                                         _D3DPRESENT_PARAMETERS_*    presParams);
00049 
00050         static void     OnPresent9  (   CATHOOK*                    hookInst,
00051                                         IDirect3DDevice9*           device,
00052                                         const RECT*                 sourceRect,
00053                                         const RECT*                 destRect,
00054                                         HWND                        destWindow,
00055                                         const RGNDATA*              pDirtyRgn);
00056 
00057         static void     OnEndScene  (   CATHOOK*                    hookInst,
00058                                         IDirect3DDevice9*           device);
00059 
00060     protected:
00061         bool               fDeviceLost;
00062         CATFloat32         fTexScaleX;
00063         CATFloat32         fTexScaleY;
00064         IDirect3DTexture9* fBackTexture;
00065         IDirect3DTexture9* fTexture;
00066         HMODULE            fD3d9DLL;
00067 };
00068 
00069 #endif // CAT_CONFIG_WIN32
00070 #endif // _CATOverlayDirect3D_H_

Generated on Mon Feb 11 04:09:46 2008 for Game Accessibility Suite by doxygen 1.5.4