You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.0 KiB
54 lines
1.0 KiB
/*
|
|
* 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 <EGL/egl.h>
|
|
#include <EGL/eglext.h>
|
|
#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
|