Torque3D Documentation / _generateds / gfxPCD3D9Device.h

gfxPCD3D9Device.h

Engine/source/gfx/D3D9/pc/gfxPCD3D9Device.h

More...

Classes:

Detailed Description

 1
 2//-----------------------------------------------------------------------------
 3// Copyright (c) 2012 GarageGames, LLC
 4//
 5// Permission is hereby granted, free of charge, to any person obtaining a copy
 6// of this software and associated documentation files (the "Software"), to
 7// deal in the Software without restriction, including without limitation the
 8// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 9// sell copies of the Software, and to permit persons to whom the Software is
10// furnished to do so, subject to the following conditions:
11//
12// The above copyright notice and this permission notice shall be included in
13// all copies or substantial portions of the Software.
14//
15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21// IN THE SOFTWARE.
22//-----------------------------------------------------------------------------
23
24#ifndef _GFX_PC_D3D9DEVICE_H_
25#define _GFX_PC_D3D9DEVICE_H_
26
27#include "gfx/D3D9/gfxD3D9Device.h"
28
29class PlatformWindow;
30class VideoFrameGrabberD3D9;
31
32
33class GFXPCD3D9Device : public GFXD3D9Device
34{
35   typedef GFXD3D9Device Parent;
36
37public:
38   // Set to true to force nvperfhud device creation
39   static bool mEnableNVPerfHUD;
40
41   GFXPCD3D9Device( LPDIRECT3D9 d3d, U32 index )
42      : GFXD3D9Device( d3d, index ),
43        mVideoFrameGrabber( NULL ) {};
44   ~GFXPCD3D9Device();
45
46   static GFXDevice *createInstance( U32 adapterIndex );
47
48   virtual GFXFormat selectSupportedFormat(GFXTextureProfile *profile,
49      const Vector<GFXFormat> &formats, bool texture, bool mustblend, bool mustfilter);
50   
51   static void enumerateAdapters( Vector<GFXAdapter*> &adapterList );
52
53   virtual void enumerateVideoModes();
54
55   virtual GFXWindowTarget *allocWindowTarget(PlatformWindow *window);
56   virtual GFXTextureTarget *allocRenderToTextureTarget();
57   virtual bool beginSceneInternal();
58
59   virtual void init( const GFXVideoMode &mode, PlatformWindow *window = NULL );
60
61   virtual void enterDebugEvent(ColorI color, const char *name);
62   virtual void leaveDebugEvent();
63   virtual void setDebugMarker(ColorI color, const char *name);
64
65   virtual void setMatrix( GFXMatrixType mtype, const MatrixF &mat );
66
67   virtual void initStates();
68   virtual void reset( D3DPRESENT_PARAMETERS &d3dpp );
69   virtual D3DPRESENT_PARAMETERS setupPresentParams( const GFXVideoMode &mode, const HWND &hwnd ) const;
70protected:
71
72   VideoFrameGrabberD3D9* mVideoFrameGrabber;
73
74   static GFXAdapter::CreateDeviceInstanceDelegate mCreateDeviceInstance;
75   static void createDirect3D9(LPDIRECT3D9 &d3d9, LPDIRECT3D9EX &d3d9ex);
76   HRESULT createDevice(U32 adapter, D3DDEVTYPE deviceType, HWND hFocusWindow, DWORD behaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters);
77
78   virtual void _setTextureStageState( U32 stage, U32 state, U32 value );      
79   void _validateMultisampleParams(D3DFORMAT format, D3DMULTISAMPLE_TYPE & aatype, DWORD & aalevel) const;
80};
81
82#endif
83