1 /*!**************************************************************************** 2 3 @file OGLES2/PVRTTextureAPI.h 4 @ingroup API_OGLES2 5 @copyright Copyright (c) Imagination Technologies Limited. 6 @brief OGLES2 texture loading. 7 8 ******************************************************************************/ 9 #ifndef _PVRTTEXTUREAPI_H_ 10 #define _PVRTTEXTUREAPI_H_ 11 12 /*! 13 @addtogroup API_OGLES2 14 @{ 15 */ 16 17 #include "../PVRTError.h" 18 19 /**************************************************************************** 20 ** Functions 21 ****************************************************************************/ 22 template <typename KeyType, typename DataType> 23 class CPVRTMap; 24 25 /*!*************************************************************************** 26 @brief Allows textures to be stored in C header files and loaded in. Can load parts of a 27 mipmaped texture (ie skipping the highest detailed levels). 28 Sets the texture MIN/MAG filter to GL_LINEAR_MIPMAP_NEAREST/GL_LINEAR 29 if mipmaps are present, GL_LINEAR/GL_LINEAR otherwise. 30 @param[in] pointer Pointer to header-texture's structure 31 @param[in,out] texName the OpenGL ES texture name as returned by glBindTexture 32 @param[in,out] psTextureHeader Pointer to a PVRTextureHeaderV3 struct. Modified to 33 contain the header data of the returned texture Ignored if NULL. 34 @param[in] bAllowDecompress Allow decompression if PVRTC is not supported in hardware. 35 @param[in] nLoadFromLevel Which mipmap level to start loading from (0=all) 36 @param[in] texPtr If null, texture follows header, else texture is here. 37 @param[in,out] pMetaData If a valid map is supplied, this will return any and all 38 MetaDataBlocks stored in the texture, organised by DevFourCC 39 then identifier. Supplying NULL will ignore all MetaData. 40 @return PVR_SUCCESS on success 41 *****************************************************************************/ 42 EPVRTError PVRTTextureLoadFromPointer( const void* pointer, 43 GLuint *const texName, 44 const void *psTextureHeader=NULL, 45 bool bAllowDecompress = true, 46 const unsigned int nLoadFromLevel=0, 47 const void * const texPtr=0, 48 CPVRTMap<unsigned int, CPVRTMap<unsigned int, struct MetaDataBlock> > *pMetaData=NULL); 49 50 /*!*************************************************************************** 51 @brief Allows textures to be stored in binary PVR files and loaded in. Can load parts of a 52 mipmaped texture (ie skipping the highest detailed levels). 53 Sets the texture MIN/MAG filter to GL_LINEAR_MIPMAP_NEAREST/GL_LINEAR 54 if mipmaps are present, GL_LINEAR/GL_LINEAR otherwise. 55 @param[in] filename Filename of the .PVR file to load the texture from 56 @param[in,out] texName the OpenGL ES texture name as returned by glBindTexture 57 @param[in,out] psTextureHeader Pointer to a PVRTextureHeaderV3 struct. Modified to 58 contain the header data of the returned texture Ignored if NULL. 59 @param[in] bAllowDecompress Allow decompression if PVRTC is not supported in hardware. 60 @param[in] nLoadFromLevel Which mipmap level to start loading from (0=all) 61 @param[in,out] pMetaData If a valid map is supplied, this will return any and all 62 MetaDataBlocks stored in the texture, organised by DevFourCC 63 then identifier. Supplying NULL will ignore all MetaData. 64 @return PVR_SUCCESS on success 65 *****************************************************************************/ 66 EPVRTError PVRTTextureLoadFromPVR( const char * const filename, 67 GLuint * const texName, 68 const void *psTextureHeader=NULL, 69 bool bAllowDecompress = true, 70 const unsigned int nLoadFromLevel=0, 71 CPVRTMap<unsigned int, CPVRTMap<unsigned int, struct MetaDataBlock> > *pMetaData=NULL); 72 73 /*!*************************************************************************** 74 @brief Returns the bits per pixel (BPP) of the format. 75 @param[in] nFormat 76 @param[in] nType 77 @return Unsigned integer representing the bits per pixel of the format 78 *****************************************************************************/ 79 unsigned int PVRTTextureFormatGetBPP(const GLuint nFormat, const GLuint nType); 80 81 /*! @} */ 82 83 #endif /* _PVRTTEXTUREAPI_H_ */ 84 85 /***************************************************************************** 86 End of file (PVRTTextureAPI.h) 87 *****************************************************************************/ 88 89