Remove GlContext from MapContext, layers receive MapContext from Initialize/Render

This commit is contained in:
Dan Paulat 2025-05-08 23:15:46 -05:00
parent 2d4ad2737e
commit 44a864f50f
25 changed files with 446 additions and 398 deletions

View file

@ -3,26 +3,32 @@
namespace scwx::qt::map
{
class GenericLayerImpl
class GenericLayer::Impl
{
public:
explicit GenericLayerImpl(std::shared_ptr<MapContext> context) :
context_ {std::move(context)}
explicit Impl(std::shared_ptr<gl::GlContext> glContext) :
glContext_ {std::move(glContext)}
{
}
~GenericLayerImpl() {}
~Impl() = default;
std::shared_ptr<MapContext> context_;
Impl(const Impl&) = delete;
Impl& operator=(const Impl&) = delete;
Impl(const Impl&&) = delete;
Impl& operator=(const Impl&&) = delete;
std::shared_ptr<gl::GlContext> glContext_;
};
GenericLayer::GenericLayer(const std::shared_ptr<MapContext>& context) :
p(std::make_unique<GenericLayerImpl>(context))
GenericLayer::GenericLayer(std::shared_ptr<gl::GlContext> glContext) :
p(std::make_unique<Impl>(std::move(glContext)))
{
}
GenericLayer::~GenericLayer() = default;
bool GenericLayer::RunMousePicking(
const std::shared_ptr<MapContext>& /* mapContext */,
const QMapLibre::CustomLayerRenderParameters& /* params */,
const QPointF& /* mouseLocalPos */,
const QPointF& /* mouseGlobalPos */,
@ -34,9 +40,9 @@ bool GenericLayer::RunMousePicking(
return false;
}
std::shared_ptr<MapContext> GenericLayer::context() const
std::shared_ptr<gl::GlContext> GenericLayer::gl_context() const
{
return p->context_;
return p->glContext_;
}
} // namespace scwx::qt::map