PVRTBackground.h 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /******************************************************************************
  2. @File PVRTBackground.h
  3. @Title PVRTBackground
  4. @Version
  5. @Copyright Copyright (C) Imagination Technologies Limited.
  6. @Platform ANSI compatible
  7. @Description Function to draw a background texture.
  8. ******************************************************************************/
  9. #ifndef __PVRTBACKGROUND_H__
  10. #define __PVRTBACKGROUND_H__
  11. #include "PVRTGlobal.h"
  12. #include "PVRTContext.h"
  13. #include "PVRTString.h"
  14. #include "PVRTError.h"
  15. /****************************************************************************
  16. ** Structures
  17. ****************************************************************************/
  18. /*!***************************************************************************
  19. @Struct SPVRTBackgroundAPI
  20. @Brief A struct for storing API specific variables
  21. *****************************************************************************/
  22. struct SPVRTBackgroundAPI;
  23. /*!***************************************************************************
  24. @Class CPVRTBackground
  25. @Brief A class for drawing a fullscreen textured background
  26. *****************************************************************************/
  27. class CPVRTBackground
  28. {
  29. public:
  30. /*!***************************************************************************
  31. @Function CPVRTBackground
  32. @Description Init some values.
  33. *****************************************************************************/
  34. CPVRTBackground(void);
  35. /*!***************************************************************************
  36. @Function ~CPVRTBackground
  37. @Description Calls Destroy()
  38. *****************************************************************************/
  39. ~CPVRTBackground(void);
  40. /*!***************************************************************************
  41. @Function Destroy
  42. @Description Destroys the background. It's called by the destructor.
  43. *****************************************************************************/
  44. void Destroy();
  45. /*!***************************************************************************
  46. @Function Init
  47. @Input pContext A pointer to a PVRTContext
  48. @Input bRotate true to rotate texture 90 degrees.
  49. @Input pszError An option string for returning errors
  50. @Return PVR_SUCCESS on success
  51. @Description Initialises the background
  52. *****************************************************************************/
  53. EPVRTError Init(const SPVRTContext * const pContext, const bool bRotate, CPVRTString *pszError = 0);
  54. #if defined(BUILD_OGL) || defined(BUILD_OGLES) || defined(BUILD_OGLES2)
  55. /*!***************************************************************************
  56. @Function Draw
  57. @Input ui32Texture Texture to use
  58. @Return PVR_SUCCESS on success
  59. @Description Draws a texture on a quad covering the whole screen.
  60. *****************************************************************************/
  61. EPVRTError Draw(const GLuint ui32Texture);
  62. #elif defined(BUILD_DX10)
  63. /*!***************************************************************************
  64. @Function Draw
  65. @Input pTexture Texture to use
  66. @Return PVR_SUCCESS on success
  67. @Description Draws a texture on a quad covering the whole screen.
  68. *****************************************************************************/
  69. EPVRTError Draw(ID3D10ShaderResourceView *pTexture);
  70. #endif
  71. protected:
  72. bool m_bInit;
  73. SPVRTBackgroundAPI *m_pAPI;
  74. };
  75. #endif /* __PVRTBACKGROUND_H__ */
  76. /*****************************************************************************
  77. End of file (PVRTBackground.h)
  78. *****************************************************************************/