Home | History | Annotate | Download | only in Tools
      1 /*!****************************************************************************
      2 
      3  @file         PVRTBackground.h
      4  @copyright    Copyright (c) Imagination Technologies Limited.
      5  @brief        Function to draw a background texture.
      6 
      7 ******************************************************************************/
      8 #ifndef __PVRTBACKGROUND_H__
      9 #define __PVRTBACKGROUND_H__
     10 
     11 #include "PVRTGlobal.h"
     12 #include "PVRTContext.h"
     13 #include "PVRTString.h"
     14 #include "PVRTError.h"
     15 
     16 /****************************************************************************
     17 ** Structures
     18 ****************************************************************************/
     19 /*!***************************************************************************
     20  @struct SPVRTBackgroundAPI
     21  @brief A struct for storing API specific variables
     22 *****************************************************************************/
     23 struct SPVRTBackgroundAPI;
     24 
     25 /*!***************************************************************************
     26  @class CPVRTBackground
     27  @brief A class for drawing a fullscreen textured background
     28 *****************************************************************************/
     29 class CPVRTBackground
     30 {
     31 	public:
     32 		/*!***************************************************************************
     33 	 	 @brief		Initialise some values.
     34 		*****************************************************************************/
     35 		CPVRTBackground(void);
     36 		/*!***************************************************************************
     37 		 @brief		Calls Destroy()
     38 		*****************************************************************************/
     39 		~CPVRTBackground(void);
     40 		/*!***************************************************************************
     41 		 @brief 	Destroys the background and releases API specific resources
     42 		*****************************************************************************/
     43 		void Destroy();
     44 
     45 		/*!***************************************************************************
     46 		 @brief      	Initialises the background
     47 		 @param[in]		pContext	A pointer to a PVRTContext
     48 		 @param[in]		bRotate		true to rotate texture 90 degrees.
     49 		 @param[in]		pszError	An option string for returning errors
     50 		 @return  		PVR_SUCCESS on success
     51 		*****************************************************************************/
     52 		EPVRTError Init(const SPVRTContext * const pContext, const bool bRotate, CPVRTString *pszError = 0);
     53 
     54 #if defined(BUILD_OGL) || defined(BUILD_OGLES) || defined(BUILD_OGLES2) || defined(BUILD_OGLES3)
     55 		/*!***************************************************************************
     56 		 @brief      	Draws a texture on a quad covering the whole screen.
     57 		 @param[in]		ui32Texture	Texture to use
     58 		 @return  		PVR_SUCCESS on success
     59 		*****************************************************************************/
     60 		EPVRTError Draw(const GLuint ui32Texture);
     61 #elif defined(BUILD_DX11)
     62 		/*!***************************************************************************
     63 		 @brief      	Draws a texture on a quad covering the whole screen.
     64 		 @param[in]		pTexture	Texture to use
     65 		 @return  		PVR_SUCCESS on success
     66 		*****************************************************************************/
     67 		EPVRTError Draw(ID3D11ShaderResourceView *pTexture);
     68 #endif
     69 
     70 	protected:
     71 		bool m_bInit;
     72 		SPVRTBackgroundAPI *m_pAPI;
     73 };
     74 
     75 
     76 #endif /* __PVRTBACKGROUND_H__ */
     77 
     78 /*****************************************************************************
     79  End of file (PVRTBackground.h)
     80 *****************************************************************************/
     81 
     82