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