mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 19:10:06 +00:00
Remove GlContext from MapContext, layers receive MapContext from Initialize/Render
This commit is contained in:
parent
2d4ad2737e
commit
44a864f50f
25 changed files with 446 additions and 398 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue