#pragma once #include #include #include namespace scwx { namespace qt { namespace gl { class GlContext { public: explicit GlContext(); virtual ~GlContext(); GlContext(const GlContext&) = delete; GlContext& operator=(const GlContext&) = delete; GlContext(GlContext&&) noexcept; GlContext& operator=(GlContext&&) noexcept; gl::OpenGLFunctions& gl(); #if !defined(__APPLE__) QOpenGLFunctions_3_0& gl30(); #endif std::uint64_t texture_buffer_count() const; std::shared_ptr GetShaderProgram(const std::string& vertexPath, const std::string& fragmentPath); std::shared_ptr GetShaderProgram( std::initializer_list> shaders); GLuint GetTextureAtlas(); void Initialize(); void StartFrame(); private: class Impl; std::unique_ptr p; }; } // namespace gl } // namespace qt } // namespace scwx