Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 1 | // Copyright 2016 The SwiftShader Authors. All Rights Reserved. |
Nicolas Capens | ee16f0d | 2015-07-16 17:40:10 -0400 | [diff] [blame] | 2 | // |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
Nicolas Capens | ee16f0d | 2015-07-16 17:40:10 -0400 | [diff] [blame] | 6 | // |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
Nicolas Capens | ee16f0d | 2015-07-16 17:40:10 -0400 | [diff] [blame] | 8 | // |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
Nicolas Capens | ee16f0d | 2015-07-16 17:40:10 -0400 | [diff] [blame] | 14 | |
| 15 | #ifndef D3D9_Direct3DCubeTexture9_hpp |
| 16 | #define D3D9_Direct3DCubeTexture9_hpp |
| 17 | |
| 18 | #include "Direct3DBaseTexture9.hpp" |
| 19 | |
| 20 | #include "Config.hpp" |
| 21 | |
| 22 | #include <d3d9.h> |
| 23 | |
| 24 | namespace D3D9 |
| 25 | { |
| 26 | class Direct3DSurface9; |
| 27 | |
| 28 | class Direct3DCubeTexture9 : public IDirect3DCubeTexture9, public Direct3DBaseTexture9 |
| 29 | { |
| 30 | public: |
| 31 | Direct3DCubeTexture9(Direct3DDevice9 *device, unsigned int edgeLength, unsigned int levels, unsigned long usage, D3DFORMAT format, D3DPOOL pool); |
| 32 | |
| 33 | virtual ~Direct3DCubeTexture9(); |
| 34 | |
| 35 | // IUnknown methods |
| 36 | long __stdcall QueryInterface(const IID &iid, void **object); |
| 37 | unsigned long __stdcall AddRef(); |
| 38 | unsigned long __stdcall Release(); |
| 39 | |
| 40 | // IDirect3DResource9 methods |
| 41 | long __stdcall GetDevice(IDirect3DDevice9 **device); |
| 42 | long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags); |
| 43 | long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size); |
| 44 | long __stdcall FreePrivateData(const GUID &guid); |
| 45 | unsigned long __stdcall SetPriority(unsigned long newPriority); |
| 46 | unsigned long __stdcall GetPriority(); |
| 47 | void __stdcall PreLoad(); |
| 48 | D3DRESOURCETYPE __stdcall GetType(); |
| 49 | |
| 50 | // IDirect3DBaseTexture9 methods |
| 51 | unsigned long __stdcall SetLOD(unsigned long newLOD); |
| 52 | unsigned long __stdcall GetLOD(); |
| 53 | unsigned long __stdcall GetLevelCount(); |
| 54 | long __stdcall SetAutoGenFilterType(D3DTEXTUREFILTERTYPE filterType); |
| 55 | D3DTEXTUREFILTERTYPE __stdcall GetAutoGenFilterType(); |
| 56 | void __stdcall GenerateMipSubLevels(); |
| 57 | |
| 58 | // IDirect3DCubeTexture9 methods |
| 59 | long __stdcall GetLevelDesc(unsigned int level, D3DSURFACE_DESC *description); |
| 60 | long __stdcall GetCubeMapSurface(D3DCUBEMAP_FACES face, unsigned int level, IDirect3DSurface9 **cubeMapSurface); |
| 61 | long __stdcall LockRect(D3DCUBEMAP_FACES face, unsigned int level, D3DLOCKED_RECT *lockedRect, const RECT *rect, unsigned long flags); |
| 62 | long __stdcall UnlockRect(D3DCUBEMAP_FACES face, unsigned int level); |
| 63 | long __stdcall AddDirtyRect(D3DCUBEMAP_FACES face, const RECT *dirtyRect); |
| 64 | |
| 65 | // Internal methods |
| 66 | Direct3DSurface9 *getInternalCubeMapSurface(D3DCUBEMAP_FACES face, unsigned int level); |
| 67 | |
| 68 | private: |
| 69 | // Creation parameters |
| 70 | const unsigned int edgeLength; |
| 71 | |
Nicolas Capens | b663f71 | 2016-04-18 12:02:39 -0400 | [diff] [blame] | 72 | Direct3DSurface9 *surfaceLevel[6][sw::MIPMAP_LEVELS]; |
Nicolas Capens | ee16f0d | 2015-07-16 17:40:10 -0400 | [diff] [blame] | 73 | }; |
| 74 | } |
| 75 | |
| 76 | #endif // D3D9_Direct3D9_hpp |