/* * Copyright (c) Hisilicon Technologies Co., Ltd. 2019-2020. All rights reserved. * Description: Draw bitmap * Author: * Create: 2019-08-23 */ #ifndef OSD_BITMAP_H #define OSD_BITMAP_H #include #include "Common.h" #include "ShaderProgram.h" namespace dolgles { using std::unique_ptr; class OSDBitmap { public: OSDBitmap(); ~OSDBitmap(); EGL_S32 Init(); void DisplayBitmap(const GLBitmapInfo &bitmapInfo, GLsizei winWidth, GLsizei winHeight); void DrawBitmap(const FrameBuffObject &fbo, const GLBitmapInfo &bitmapInfo); private: void RenderBitmap(const GLRectInfo &rect) const; void CreateTexture(const GLBitmapInfo &bitmapInfo); void DeleteTexture(); unique_ptr shaderProgram; GLuint texture; GLuint program; GLuint vbo; GLint uniformTex; GLint attribCoord; }; }; // namespace dolgles #endif // end OSD_BITMAP_H