mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 03:40:05 +00:00 
			
		
		
		
	Create shader programs through map context in order to cache programs through re-initialization
This commit is contained in:
		
							parent
							
								
									32e8ca72a0
								
							
						
					
					
						commit
						a45e996872
					
				
					 10 changed files with 324 additions and 144 deletions
				
			
		|  | @ -1,6 +1,7 @@ | |||
| #pragma once | ||||
| 
 | ||||
| #include <scwx/qt/gl/gl.hpp> | ||||
| #include <scwx/qt/gl/shader_program.hpp> | ||||
| #include <scwx/qt/map/map_settings.hpp> | ||||
| #include <scwx/qt/view/radar_product_view.hpp> | ||||
| 
 | ||||
|  | @ -11,32 +12,40 @@ namespace qt | |||
| namespace map | ||||
| { | ||||
| 
 | ||||
| struct MapContext | ||||
| class MapContext | ||||
| { | ||||
| public: | ||||
|    explicit MapContext( | ||||
|       std::shared_ptr<view::RadarProductView> radarProductView = nullptr) : | ||||
|        gl_ {}, | ||||
|        settings_ {}, | ||||
|        radarProductView_ {radarProductView}, | ||||
|        radarProductGroup_ {common::RadarProductGroup::Unknown}, | ||||
|        radarProduct_ {"???"}, | ||||
|        radarProductCode_ {0} | ||||
|    { | ||||
|    } | ||||
|    ~MapContext() = default; | ||||
|       std::shared_ptr<view::RadarProductView> radarProductView = nullptr); | ||||
|    ~MapContext(); | ||||
| 
 | ||||
|    MapContext(const MapContext&) = delete; | ||||
|    MapContext(const MapContext&)            = delete; | ||||
|    MapContext& operator=(const MapContext&) = delete; | ||||
| 
 | ||||
|    MapContext(MapContext&&) noexcept = default; | ||||
|    MapContext& operator=(MapContext&&) noexcept = default; | ||||
|    MapContext(MapContext&&) noexcept; | ||||
|    MapContext& operator=(MapContext&&) noexcept; | ||||
| 
 | ||||
|    gl::OpenGLFunctions                     gl_; | ||||
|    MapSettings                             settings_; | ||||
|    std::shared_ptr<view::RadarProductView> radarProductView_; | ||||
|    common::RadarProductGroup               radarProductGroup_; | ||||
|    std::string                             radarProduct_; | ||||
|    int16_t                                 radarProductCode_; | ||||
|    gl::OpenGLFunctions&                    gl(); | ||||
|    MapSettings&                            settings(); | ||||
|    std::shared_ptr<view::RadarProductView> radar_product_view() const; | ||||
|    common::RadarProductGroup               radar_product_group() const; | ||||
|    std::string                             radar_product() const; | ||||
|    int16_t                                 radar_product_code() const; | ||||
| 
 | ||||
|    void set_radar_product_view( | ||||
|       std::shared_ptr<view::RadarProductView> radarProductView); | ||||
|    void set_radar_product_group(common::RadarProductGroup radarProductGroup); | ||||
|    void set_radar_product(const std::string& radarProduct); | ||||
|    void set_radar_product_code(int16_t radarProductCode); | ||||
| 
 | ||||
|    std::shared_ptr<gl::ShaderProgram> | ||||
|    GetShaderProgram(const std::string& vertexPath, | ||||
|                     const std::string& fragmentPath); | ||||
| 
 | ||||
| private: | ||||
|    class Impl; | ||||
| 
 | ||||
|    std::unique_ptr<Impl> p; | ||||
| }; | ||||
| 
 | ||||
| } // namespace map
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat