/* * Copyright (c) Hisilicon Technologies Co., Ltd. 2019-2020. All rights reserved. * Description: EGL manager * Author: * Create: 2019-08-09 */ #ifndef EGL_MANAGER_H #define EGL_MANAGER_H #include #include #include "DFXDefine.h" namespace dolgles { class EGLManager { public: EGLManager(); ~EGLManager(); // Init display, create config and context. EGL_S32 EGLSetupContext(); // Creates an EGL window for the supplied native window. EGL_S32 CreateWindowSurface(EGLNativeWindowType nativeWindow); EGL_S32 CreatePBufferSurface(); EGL_S32 GetWindowWidth() const; EGL_S32 GetWindowHeight() const; // Release source void Release(); EGL_S32 MakeCurrent(); // Swaps the EGL buffer. void SwapBuffers() const; private: void EGLRelease(); EGLDisplay eglDisplay; EGLContext eglContext; EGLSurface eglSurface; EGLConfig eglConfig; // Surface dimensions. int width; int height; }; }; // namespace dolgles #endif // end EGL_MANAGER_H