/* * Copyright (c) Hisilicon Technologies Co., Ltd. 2019-2020. All rights reserved. * Description: Frame buffer object * Author: * Create: 2019-08-28 */ #ifndef FBO_MANAGER_H #define FBO_MANAGER_H #include "Common.h" namespace dolgles { constexpr EGL_U32 FBO_HANDLE_INDEX = 0x00010000; constexpr EGL_S32 MAX_FBO_NUM = 16; class FBOManager { public: FBOManager(EGL_S32 winWidth, EGL_S32 winHeight); ~FBOManager(); EGL_S32 GLCreateFBO(EGL_U32 &fboHandleIndex, GLsizei width, GLsizei height, GLint format, bool isReset); void GLDestoryFBO(EGL_U32 fboHandleIndex); bool GetFBOInst(EGL_U32 fboHandleIndex, FrameBuffObject &fbo) const; void ClearFBOTex(const FrameBuffObject &fbo, const ColorRGBA &color) const; void UpdateSurfaceWidthHeight(EGL_S32 winWidth, EGL_S32 winHeight); private: void InitFBO(FrameBuffObject &fbo) const; FrameBuffObject mFBO[MAX_FBO_NUM]; }; }; // namespace dolgles #endif // end FBO_MANAGER_H