Torque3D Documentation / _generateds / gfxD3D9TextureObject.h

gfxD3D9TextureObject.h

Engine/source/gfx/D3D9/gfxD3D9TextureObject.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 _GFXD3D9TEXTUREOBJECT_H_
25#define _GFXD3D9TEXTUREOBJECT_H_
26
27#ifndef _GFXTEXTUREHANDLE_H_
28#include "gfx/gfxTextureHandle.h"
29#endif
30
31#ifndef _GFXTEXTUREMANAGER_H_
32#include "gfx/gfxTextureManager.h"
33#endif
34
35
36class GFXD3D9TextureObject : public GFXTextureObject
37{
38protected:
39   static U32 mTexCount;
40   GFXTexHandle   mLockTex;
41   D3DLOCKED_RECT mLockRect;
42   bool           mLocked;
43
44   IDirect3DBaseTexture9 *mD3DTexture;
45
46   // used for z buffers...
47   IDirect3DSurface9 *mD3DSurface;
48
49public:
50
51   GFXD3D9TextureObject( GFXDevice * d, GFXTextureProfile *profile);
52   ~GFXD3D9TextureObject();
53
54   IDirect3DBaseTexture9 *    getTex(){ return mD3DTexture; }
55   IDirect3DTexture9 *        get2DTex(){ return (LPDIRECT3DTEXTURE9) mD3DTexture; }
56   IDirect3DTexture9 **       get2DTexPtr(){ return (LPDIRECT3DTEXTURE9*) &mD3DTexture; }
57   IDirect3DVolumeTexture9 *  get3DTex(){ return (LPDIRECT3DVOLUMETEXTURE9) mD3DTexture; }
58   IDirect3DVolumeTexture9 ** get3DTexPtr(){ return (LPDIRECT3DVOLUMETEXTURE9*) &mD3DTexture; }
59
60   void release();
61
62   bool isManaged;
63
64   virtual GFXLockedRect * lock(U32 mipLevel = 0, RectI *inRect = NULL);
65   virtual void unlock(U32 mipLevel = 0 );
66
67   virtual bool copyToBmp(GBitmap* bmp);
68   IDirect3DSurface9 *getSurface() {return mD3DSurface;}
69   IDirect3DSurface9 **getSurfacePtr() {return &mD3DSurface;}
70
71   // GFXResource
72   void zombify();
73   void resurrect();
74
75#ifdef TORQUE_DEBUG
76   virtual void pureVirtualCrash() {};
77#endif
78};
79
80
81#endif
82