1fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt/* 2fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * Copyright 2011 Joakim Sindholt <opensource@zhasha.com> 3fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * 4fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * Permission is hereby granted, free of charge, to any person obtaining a 5fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * copy of this software and associated documentation files (the "Software"), 6fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * to deal in the Software without restriction, including without limitation 7fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * on the rights to use, copy, modify, merge, publish, distribute, sub 8fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * license, and/or sell copies of the Software, and to permit persons to whom 9fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * the Software is furnished to do so, subject to the following conditions: 10fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * 11fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * The above copyright notice and this permission notice (including the next 12fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * paragraph) shall be included in all copies or substantial portions of the 13fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * Software. 14fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * 15fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL 18fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, 19fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 21fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * USE OR OTHER DEALINGS IN THE SOFTWARE. */ 22fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt 23fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt#ifndef _NINE_CUBETEXTURE9_H_ 24fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt#define _NINE_CUBETEXTURE9_H_ 25fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt 26fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt#include "basetexture9.h" 27fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt#include "surface9.h" 28fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt 29fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholtstruct NineCubeTexture9 30fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt{ 31fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt struct NineBaseTexture9 base; 32fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt struct NineSurface9 **surfaces; 33fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt struct pipe_box dirty_rect[6]; /* covers all mip levels */ 3435fe920e1ec877d487e5dd33c9aea7e1ec1dbe11Axel Davy uint8_t *managed_buffer; 35fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt}; 36a2a1a5805fd617e7f3cc8be44dd79b50da07ebb9Ilia Mirkinstatic inline struct NineCubeTexture9 * 37fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim SindholtNineCubeTexture9( void *data ) 38fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt{ 39fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt return (struct NineCubeTexture9 *)data; 40fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt} 41fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt 42fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim SindholtHRESULT 43fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim SindholtNineCubeTexture9_new( struct NineDevice9 *pDevice, 44fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt UINT EdgeLength, UINT Levels, 45fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt DWORD Usage, 46fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt D3DFORMAT Format, 47fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt D3DPOOL Pool, 48fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt struct NineCubeTexture9 **ppOut, 49fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt HANDLE *pSharedHandle ); 50fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt 5177d6c11f8fa87ba1070028cb036807dc8a115633Axel DavyHRESULT NINE_WINAPI 52fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim SindholtNineCubeTexture9_GetLevelDesc( struct NineCubeTexture9 *This, 53fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt UINT Level, 54fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt D3DSURFACE_DESC *pDesc ); 55fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt 5677d6c11f8fa87ba1070028cb036807dc8a115633Axel DavyHRESULT NINE_WINAPI 57fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim SindholtNineCubeTexture9_GetCubeMapSurface( struct NineCubeTexture9 *This, 58fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt D3DCUBEMAP_FACES FaceType, 59fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt UINT Level, 60fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt IDirect3DSurface9 **ppCubeMapSurface ); 61fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt 6277d6c11f8fa87ba1070028cb036807dc8a115633Axel DavyHRESULT NINE_WINAPI 63fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim SindholtNineCubeTexture9_LockRect( struct NineCubeTexture9 *This, 64fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt D3DCUBEMAP_FACES FaceType, 65fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt UINT Level, 66fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt D3DLOCKED_RECT *pLockedRect, 67fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt const RECT *pRect, 68fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt DWORD Flags ); 69fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt 7077d6c11f8fa87ba1070028cb036807dc8a115633Axel DavyHRESULT NINE_WINAPI 71fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim SindholtNineCubeTexture9_UnlockRect( struct NineCubeTexture9 *This, 72fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt D3DCUBEMAP_FACES FaceType, 73fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt UINT Level ); 74fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt 7577d6c11f8fa87ba1070028cb036807dc8a115633Axel DavyHRESULT NINE_WINAPI 76fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim SindholtNineCubeTexture9_AddDirtyRect( struct NineCubeTexture9 *This, 77fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt D3DCUBEMAP_FACES FaceType, 78fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt const RECT *pDirtyRect ); 79fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt 80fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt#endif /* _NINE_CUBETEXTURE9_H_ */ 81