Repo created

This commit is contained in:
Fr4nz D13trich 2025-11-22 13:58:55 +01:00
parent 4af19165ec
commit 68073add76
12458 changed files with 12350765 additions and 2 deletions

View file

@ -0,0 +1,43 @@
#pragma once
#include "drape/graphics_context_factory.hpp"
#include "qt/qt_common/qtoglcontext.hpp"
#include <QtGui/QOpenGLContext>
#include <memory>
namespace qt
{
namespace common
{
class QtOGLContextFactory : public dp::GraphicsContextFactory
{
public:
QtOGLContextFactory(QOpenGLContext * rootContext);
~QtOGLContextFactory() override;
void PrepareToShutdown();
bool AcquireFrame();
GLuint GetTextureHandle() const;
QRectF const & GetTexRect() const;
// dp::GraphicsContextFactory overrides:
dp::GraphicsContext * GetDrawContext() override;
dp::GraphicsContext * GetResourcesUploadContext() override;
bool IsDrawContextCreated() const override { return m_drawContext != nullptr; }
bool IsUploadContextCreated() const override { return m_uploadContext != nullptr; }
private:
std::unique_ptr<QOffscreenSurface> CreateSurface();
QOpenGLContext * m_rootContext;
std::unique_ptr<QtRenderOGLContext> m_drawContext;
std::unique_ptr<QOffscreenSurface> m_drawSurface;
std::unique_ptr<QtUploadOGLContext> m_uploadContext;
std::unique_ptr<QOffscreenSurface> m_uploadSurface;
bool m_preparedToShutdown = false;
};
} // namespace common
} // namespace qt