PVRTTextureAPI.h 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /******************************************************************************
  2. @File PVRTTextureAPI.h
  3. @Title OGLES2/PVRTTextureAPI
  4. @Version
  5. @Copyright Copyright (C) Imagination Technologies Limited.
  6. @Platform ANSI compatible
  7. @Description OGLES2 texture loading.
  8. ******************************************************************************/
  9. #ifndef _PVRTTEXTUREAPI_H_
  10. #define _PVRTTEXTUREAPI_H_
  11. #include "../PVRTError.h"
  12. /****************************************************************************
  13. ** Functions
  14. ****************************************************************************/
  15. /*!***************************************************************************
  16. @Function PVRTTextureLoadFromPointer
  17. @Input pointer Pointer to header-texture's structure
  18. @Modified texName the OpenGL ES texture name as returned by glBindTexture
  19. @Modified psTextureHeader Pointer to a PVR_Texture_Header struct. Modified to
  20. contain the header data of the returned texture Ignored if NULL.
  21. @Input bAllowDecompress Allow decompression if PVRTC is not supported in hardware.
  22. @Input nLoadFromLevel Which mipmap level to start loading from (0=all)
  23. @Input texPtr If null, texture follows header, else texture is here.
  24. @Return PVR_SUCCESS on success
  25. @Description Allows textures to be stored in C header files and loaded in. Can load parts of a
  26. mipmaped texture (ie skipping the highest detailed levels).
  27. Sets the texture MIN/MAG filter to GL_LINEAR_MIPMAP_NEAREST/GL_LINEAR
  28. if mipmaps are present, GL_LINEAR/GL_LINEAR otherwise.
  29. *****************************************************************************/
  30. EPVRTError PVRTTextureLoadFromPointer( const void* pointer,
  31. GLuint *const texName,
  32. const void *psTextureHeader=NULL,
  33. bool bAllowDecompress = true,
  34. const unsigned int nLoadFromLevel=0,
  35. const void * const texPtr=0);
  36. /*!***************************************************************************
  37. @Function PVRTTextureLoadFromPVR
  38. @Input filename Filename of the .PVR file to load the texture from
  39. @Modified texName the OpenGL ES texture name as returned by glBindTexture
  40. @Modified psTextureHeader Pointer to a PVR_Texture_Header struct. Modified to
  41. contain the header data of the returned texture Ignored if NULL.
  42. @Input bAllowDecompress Allow decompression if PVRTC is not supported in hardware.
  43. @Input nLoadFromLevel Which mipmap level to start loading from (0=all)
  44. @Return PVR_SUCCESS on success
  45. @Description Allows textures to be stored in binary PVR files and loaded in. Can load parts of a
  46. mipmaped texture (ie skipping the highest detailed levels).
  47. Sets the texture MIN/MAG filter to GL_LINEAR_MIPMAP_NEAREST/GL_LINEAR
  48. if mipmaps are present, GL_LINEAR/GL_LINEAR otherwise.
  49. *****************************************************************************/
  50. EPVRTError PVRTTextureLoadFromPVR( const char * const filename,
  51. GLuint * const texName,
  52. const void *psTextureHeader=NULL,
  53. bool bAllowDecompress = true,
  54. const unsigned int nLoadFromLevel=0);
  55. /*!***************************************************************************
  56. @Function PVRTTextureFormatGetBPP
  57. @Input nFormat
  58. @Input nType
  59. @Description Returns the bits per pixel (BPP) of the format.
  60. *****************************************************************************/
  61. unsigned int PVRTTextureFormatGetBPP(const GLuint nFormat, const GLuint nType);
  62. #endif /* _PVRTTEXTUREAPI_H_ */
  63. /*****************************************************************************
  64. End of file (PVRTTextureAPI.h)
  65. *****************************************************************************/