15 #ifndef __EGLRENDERING_H__ |
15 #ifndef __EGLRENDERING_H__ |
16 #define __EGLRENDERING_H__ |
16 #define __EGLRENDERING_H__ |
17 |
17 |
18 #include <e32base.h> |
18 #include <e32base.h> |
19 #include <w32std.h> |
19 #include <w32std.h> |
20 #include <EGL/egl.h> |
20 #include <egl/egl.h> |
21 #include <VG/openvg.h> |
21 #include <vg/openvg.h> |
|
22 #include <gles/gl.h> |
22 |
23 |
23 class CEGLRendering : public CBase |
24 class CEGLRendering : public CBase |
24 { |
25 { |
25 public: |
26 public: |
26 ~CEGLRendering(); |
27 ~CEGLRendering(); |
27 |
28 |
28 static TInt TimerCallBack(TAny* aDemo); |
29 static TInt TimerCallBack(TAny* aDemo); |
29 void Redraw(); |
30 void Redraw(); |
30 |
31 |
31 protected: |
32 protected: |
32 CEGLRendering(RWindow& aWindow); |
33 CEGLRendering(RWindow& aWindow, EGLenum aApi); |
33 void ConstructL(); |
34 void ConstructL(); |
|
35 TSize WindowSize() const; |
34 |
36 |
35 void StartRedrawTimer(); |
37 void StartRedrawTimer(); |
36 void StopRedrawTimer(); |
38 void StopRedrawTimer(); |
37 |
39 |
38 static void EGLCheckError(); |
40 static void EGLCheckError(); |
39 static void EGLCheckReturnError(EGLBoolean aBool); |
41 static void EGLCheckReturnError(EGLBoolean aBool); |
40 static void VGCheckError(); |
42 static void VGCheckError(); |
|
43 static void GLCheckError(); |
41 |
44 |
42 private: |
45 private: |
43 void EglSetupL(); |
46 void EglSetupL(); |
44 virtual void KhrSetup() = 0; |
47 virtual void KhrSetup() = 0; |
45 virtual void KhrPaint() = 0; |
48 virtual void KhrPaint() = 0; |
46 void EglSwapBuffers(); |
49 void EglSwapBuffers(); |
47 |
50 |
48 private: |
51 private: |
49 RWindow& iWindow; |
52 RWindow& iWindow; |
|
53 const EGLenum iApi; |
50 CPeriodic* iRedrawTimer; |
54 CPeriodic* iRedrawTimer; |
51 EGLDisplay iDisplay; |
55 EGLDisplay iDisplay; |
52 EGLSurface iSurface; |
56 EGLSurface iSurface; |
53 EGLContext iContext; |
57 EGLContext iContext; |
54 }; |
58 }; |