mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 03:30:06 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			50 lines
		
	
	
	
		
			1.1 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			50 lines
		
	
	
	
		
			1.1 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
| #pragma once
 | |
| 
 | |
| #include <scwx/qt/gl/gl.hpp>
 | |
| 
 | |
| #include <memory>
 | |
| 
 | |
| #include <QMapbox>
 | |
| 
 | |
| namespace scwx
 | |
| {
 | |
| namespace qt
 | |
| {
 | |
| namespace gl
 | |
| {
 | |
| namespace draw
 | |
| {
 | |
| 
 | |
| class DrawItem
 | |
| {
 | |
| public:
 | |
|    explicit DrawItem(OpenGLFunctions& gl);
 | |
|    ~DrawItem();
 | |
| 
 | |
|    DrawItem(const DrawItem&)            = delete;
 | |
|    DrawItem& operator=(const DrawItem&) = delete;
 | |
| 
 | |
|    DrawItem(DrawItem&&) noexcept;
 | |
|    DrawItem& operator=(DrawItem&&) noexcept;
 | |
| 
 | |
|    virtual void Initialize()                                               = 0;
 | |
|    virtual void Render(const QMapbox::CustomLayerRenderParameters& params) = 0;
 | |
|    virtual void Deinitialize()                                             = 0;
 | |
| 
 | |
| protected:
 | |
|    void UseDefaultProjection(const QMapbox::CustomLayerRenderParameters& params,
 | |
|                              GLint uMVPMatrixLocation);
 | |
|    void UseMapProjection(const QMapbox::CustomLayerRenderParameters& params,
 | |
|                          GLint uMVPMatrixLocation,
 | |
|                          GLint uMapScreenCoordLocation);
 | |
| 
 | |
| private:
 | |
|    class Impl;
 | |
| 
 | |
|    std::unique_ptr<Impl> p;
 | |
| };
 | |
| 
 | |
| } // namespace draw
 | |
| } // namespace gl
 | |
| } // namespace qt
 | |
| } // namespace scwx
 | 
