• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*!****************************************************************************
2 
3  @file         KEGL/PVRShellAPI.h
4  @ingroup      API_KEGL
5  @copyright    Copyright (c) Imagination Technologies Limited.
6  @brief        3D API context management for KEGL.
7  @details      Makes programming for 3D APIs easier by wrapping surface
8                initialization, Texture allocation and other functions for use by a demo.
9 
10 ******************************************************************************/
11 
12 #ifndef __PVRSHELLAPI_H_
13 #define __PVRSHELLAPI_H_
14 
15 /****************************************************************************
16 ** 3D API header files
17 ****************************************************************************/
18 #if defined(BUILD_OGLES2)
19 	#include <GLES2/gl2.h>
20 	#include <GLES2/gl2ext.h>
21 	#include <EGL/egl.h>
22 	#include <EGL/eglext.h>
23 #elif defined(BUILD_OGLES3)
24 	#include <GLES3/gl3.h>
25 	#include <GLES2/gl2ext.h>
26 	#include <GLES3/gl3ext.h>
27 	#include <EGL/egl.h>
28 	#include <EGL/eglext.h>
29 #elif defined(BUILD_OGL)
30 #define SUPPORT_OPENGL
31 #if defined(_WIN32)
32 	#include <windows.h>
33 #endif
34 	#include <GL/gl.h>
35 	#include <EGL/egl.h>
36 	#include <EGL/eglext.h>
37 #else
38 	#include <EGL/egl.h>
39 	#include <EGL/eglext.h>
40 	#include <GLES/gl.h>
41 	#include <GLES/glext.h>
42 	#include <GLES/glplatform.h>
43 #endif
44 
45 /*!***************************************************************************
46  @addtogroup API_KEGL
47  @brief      KEGL API
48  @{
49 ****************************************************************************/
50 
51 /*!***************************************************************************
52  @class PVRShellInitAPI
53  @brief Initialisation interface with specific API.
54 ****************************************************************************/
55 class PVRShellInitAPI
56 {
57 public:
58 	EGLDisplay	m_EGLDisplay;
59 	EGLSurface	m_EGLWindow;
60 	EGLContext	m_EGLContext;
61 	EGLConfig	m_EGLConfig;
62 	EGLint		m_MajorVersion, m_MinorVersion;
63 	bool		m_bPowerManagementSupported;
64 	EGLint		m_iRequestedConfig;
65 	EGLint		m_iConfig;
66 
67 	EGLNativeDisplayType m_NDT;
68 	EGLNativePixmapType  m_NPT;
69 	EGLNativeWindowType  m_NWT;
70 
71 
72 public:
PVRShellInitAPI()73 	PVRShellInitAPI() : m_bPowerManagementSupported(false), m_iRequestedConfig(0), m_iConfig(0) {}
74 	EGLConfig SelectEGLConfiguration(const PVRShellData * const pData);
75 	const char *StringFrom_eglGetError() const;
76 
77 #if defined(BUILD_OGLES) || defined(BUILD_OGLES2)
78 protected:
79 	typedef void (GL_APIENTRY * PFNGLDISCARDFRAMEBUFFEREXT)(GLenum target, GLsizei numAttachments, const GLenum *attachments);
80 	PFNGLDISCARDFRAMEBUFFEREXT			glDiscardFramebufferEXT;
81 #endif
82 
83 };
84 
85 /*! @} */
86 
87 #endif // __PVRSHELLAPI_H_
88 
89 /*****************************************************************************
90  End of file (PVRShellAPI.h)
91 *****************************************************************************/
92 
93