1 #pragma once 2 3 #include <EGL/egl.h> 4 5 class EglState 6 { 7 public: 8 EglState(void *native_display); 9 ~EglState(); 10 display()11 EGLDisplay display() const { return m_display; } config()12 EGLConfig config() const { return m_config; } context()13 EGLContext context() const { return m_context; } 14 15 private: 16 EGLDisplay m_display; 17 EGLConfig m_config; 18 EGLContext m_context; 19 }; 20 21 class EglSurface 22 { 23 public: 24 EglSurface(const EglState& egl, void *native_window); 25 ~EglSurface(); 26 27 void make_current(); 28 void swap_buffers(); 29 30 private: 31 const EglState& egl; 32 33 EGLSurface esurface; 34 }; 35