Home | History | Annotate | Download | only in OGLES3
      1 /*!****************************************************************************
      2 
      3  @file         OGLES3/PVRTgles3Ext.h
      4  @ingroup      API_OGLES3
      5  @copyright    Copyright (c) Imagination Technologies Limited.
      6  @brief        OpenGL ES 3.0 extensions
      7 
      8 ******************************************************************************/
      9 #ifndef _PVRTgles3Ext_H_
     10 #define _PVRTgles3Ext_H_
     11 
     12 /*!
     13  @addtogroup   API_OGLES3
     14  @{
     15 */
     16 
     17 #if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE==1
     18 #import  <OpenGLES/ES3/gl.h>
     19 #import  <OpenGLES/ES3/glext.h>
     20 // No binary shaders are allowed on the iphone and so this value is not defined
     21 // Defining here allows for a more graceful fail of binary shader loading at runtime
     22 // which can be recovered from instead of fail at compile time
     23 #define GL_SGX_BINARY_IMG 0
     24 #else
     25 #ifdef BUILD_OGLES31
     26 	#include <GLES3/gl31.h>
     27 #else
     28 	#include <GLES3/gl3.h>
     29 #endif
     30 #endif
     31 
     32 #if !defined(EGL_NOT_PRESENT)
     33 #define PVRGetProcAddress(x) eglGetProcAddress(#x)
     34 #endif
     35 
     36 /****************************************************************************
     37 ** Build options
     38 ****************************************************************************/
     39 
     40 #define GL_PVRTGLESEXT_VERSION 3
     41 
     42 /**************************************************************************
     43 ****************************** GL EXTENSIONS ******************************
     44 **************************************************************************/
     45 
     46 /*!**************************************************************************
     47  @class         CPVRTgles3Ext
     48  @brief         A class for initialising and managing OGLES3 extensions
     49 ****************************************************************************/
     50 class CPVRTgles3Ext
     51 {
     52 public:
     53     // typedef definition for pointers to functions returned by eglGetProcAddress
     54     typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXT)(GLenum, GLsizei, GLenum, GLsizei, GLsizei);
     55     typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXT)(GLenum, GLenum, GLenum, GLuint,GLint, GLsizei);
     56 
     57     typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMG)(GLenum, GLsizei, GLenum, GLsizei, GLsizei);
     58     typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMG)(GLenum, GLenum, GLenum, GLuint,GLint, GLsizei);
     59 
     60     // GL_IMG_multisampled_render_to_texture
     61 #if !defined(GL_IMG_multisampled_render_to_texture)
     62 #define GL_RENDERBUFFER_SAMPLES_IMG                 0x9133
     63 #define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_IMG   0x9134
     64 #define GL_MAX_SAMPLES_IMG                          0x9135
     65 #define GL_TEXTURE_SAMPLES_IMG                      0x9136
     66 #endif
     67 
     68     // GL_EXT_multisampled_render_to_texture
     69 #if !defined(GL_EXT_multisampled_render_to_texture)
     70 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT           0x8D6C
     71 #define GL_RENDERBUFFER_SAMPLES_EXT                             0x8CAB
     72 #define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT               0x8D56
     73 #define GL_MAX_SAMPLES_EXT                                      0x8D57
     74 #endif
     75 
     76     PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXT glRenderbufferStorageMultisampleEXT;
     77     PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMG glRenderbufferStorageMultisampleIMG;
     78     PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXT glFramebufferTexture2DMultisampleEXT;
     79     PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMG glFramebufferTexture2DMultisampleIMG;
     80 
     81 	/*!***********************************************************************
     82 	@brief		Initialises IMG extensions
     83 	*************************************************************************/
     84 	void LoadExtensions();
     85 
     86 	/*!***********************************************************************
     87 	@brief		Queries for support of an extension
     88 	@param[in]	extension    Extension to query for
     89 	@return		True if the extension is supported
     90 	*************************************************************************/
     91 	static bool IsGLExtensionSupported(const char * const extension);
     92 };
     93 
     94 /*! @} */
     95 
     96 #endif /* _PVRTgles3Ext_H_ */
     97 
     98 /*****************************************************************************
     99  End of file (PVRTgles3Ext.h)
    100 *****************************************************************************/
    101 
    102