PVRTgles2Ext.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /******************************************************************************
  2. @File PVRTgles2Ext.h
  3. @Title PVRTgles2Ext
  4. @Version
  5. @Copyright Copyright (C) Imagination Technologies Limited.
  6. @Platform Independent
  7. @Description OpenGL ES 2.0 extensions
  8. ******************************************************************************/
  9. #ifndef _PVRTGLES2EXT_H_
  10. #define _PVRTGLES2EXT_H_
  11. #ifdef __APPLE__
  12. #ifdef TARGET_OS_IPHONE
  13. #import <OpenGLES/ES2/gl.h>
  14. #import <OpenGLES/ES2/glext.h>
  15. // No binary shaders are allowed on the iphone and so this value is not defined
  16. // Defining here allows for a more graceful fail of binary shader loading at runtime
  17. // which can be recovered from instead of fail at compile time
  18. #define GL_SGX_BINARY_IMG 0
  19. #else
  20. #include <EGL/egl.h>
  21. #include <GLES2/gl2.h>
  22. #include <GLES2/gl2ext.h>
  23. #include <GLES2/gl2extimg.h>
  24. #endif
  25. #else
  26. #if defined(__BADA__)
  27. #include <FGraphicsOpengl2.h>
  28. using namespace Osp::Graphics::Opengl;
  29. #else
  30. #if !defined(EGL_NOT_PRESENT)
  31. #include <EGL/egl.h>
  32. #endif
  33. #include <GLES2/gl2.h>
  34. #include <GLES2/gl2ext.h>
  35. #endif
  36. #include <GLES2/gl2extimg.h>
  37. #endif
  38. /****************************************************************************
  39. ** Build options
  40. ****************************************************************************/
  41. #define GL_PVRTGLESEXT_VERSION 2
  42. /**************************************************************************
  43. ****************************** GL EXTENSIONS ******************************
  44. **************************************************************************/
  45. class CPVRTgles2Ext
  46. {
  47. public:
  48. /* Type definitions for pointers to functions returned by eglGetProcAddress*/
  49. typedef void (GL_APIENTRY *PFNGLMULTIDRAWELEMENTS) (GLenum mode, GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount); // glvoid
  50. typedef void* (GL_APIENTRY *PFNGLMAPBUFFEROES)(GLenum target, GLenum access);
  51. typedef GLboolean (GL_APIENTRY *PFNGLUNMAPBUFFEROES)(GLenum target);
  52. typedef void (GL_APIENTRY *PFNGLGETBUFFERPOINTERVOES)(GLenum target, GLenum pname, void** params);
  53. typedef void (GL_APIENTRY * PFNGLMULTIDRAWARRAYS) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); // glvoid
  54. typedef void (GL_APIENTRY * PFNGLDISCARDFRAMEBUFFEREXT)(GLenum target, GLsizei numAttachments, const GLenum *attachments);
  55. /* GL_EXT_multi_draw_arrays */
  56. PFNGLMULTIDRAWELEMENTS glMultiDrawElementsEXT;
  57. PFNGLMULTIDRAWARRAYS glMultiDrawArraysEXT;
  58. /* GL_EXT_multi_draw_arrays */
  59. PFNGLMAPBUFFEROES glMapBufferOES;
  60. PFNGLUNMAPBUFFEROES glUnmapBufferOES;
  61. PFNGLGETBUFFERPOINTERVOES glGetBufferPointervOES;
  62. /* GL_EXT_discard_framebuffer */
  63. PFNGLDISCARDFRAMEBUFFEREXT glDiscardFramebufferEXT;
  64. public:
  65. /*!***********************************************************************
  66. @Function LoadExtensions
  67. @Description Initialises IMG extensions
  68. *************************************************************************/
  69. void LoadExtensions();
  70. /*!***********************************************************************
  71. @Function IsGLExtensionSupported
  72. @Input extension extension to query for
  73. @Returns True if the extension is supported
  74. @Description Queries for support of an extension
  75. *************************************************************************/
  76. static bool IsGLExtensionSupported(const char *extension);
  77. };
  78. #endif /* _PVRTGLES2EXT_H_ */
  79. /*****************************************************************************
  80. End of file (PVRTgles2Ext.h)
  81. *****************************************************************************/