mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 00:30:05 +00:00 
			
		
		
		
	Inital code for per map layer ImGui contexts
This commit is contained in:
		
							parent
							
								
									e641c0b0e5
								
							
						
					
					
						commit
						6d107f6c2d
					
				
					 7 changed files with 153 additions and 15 deletions
				
			
		|  | @ -114,6 +114,7 @@ public: | |||
|       context_->set_map_provider( | ||||
|          GetMapProvider(generalSettings.map_provider().GetValue())); | ||||
|       context_->set_overlay_product_view(overlayProductView); | ||||
|       context_->set_widget(widget); | ||||
| 
 | ||||
|       // Initialize map data
 | ||||
|       SetRadarSite(generalSettings.default_radar_site().GetValue()); | ||||
|  | @ -1571,21 +1572,10 @@ void MapWidget::paintGL() | |||
|    // Handle hotkey updates
 | ||||
|    p->HandleHotkeyUpdates(); | ||||
| 
 | ||||
|    // Setup ImGui Frame
 | ||||
|    ImGui::SetCurrentContext(p->imGuiContext_); | ||||
| 
 | ||||
|    // Lock ImGui font atlas prior to new ImGui frame
 | ||||
|    std::shared_lock imguiFontAtlasLock { | ||||
|       manager::FontManager::Instance().imgui_font_atlas_mutex()}; | ||||
| 
 | ||||
|    // Start ImGui Frame
 | ||||
|    ImGui_ImplQt_NewFrame(this); | ||||
|    ImGui_ImplOpenGL3_NewFrame(); | ||||
|    p->ImGuiCheckFonts(); | ||||
|    ImGui::NewFrame(); | ||||
| 
 | ||||
|    // Set default font
 | ||||
|    ImGui::PushFont(defaultFont->font()); | ||||
| 
 | ||||
|    // Update pixel ratio
 | ||||
|    p->context_->set_pixel_ratio(pixelRatio()); | ||||
|  | @ -1596,6 +1586,19 @@ void MapWidget::paintGL() | |||
|                                        size() * pixelRatio()); | ||||
|    p->map_->render(); | ||||
| 
 | ||||
|    // ImGui tool tip code
 | ||||
|    // Setup ImGui Frame
 | ||||
|    ImGui::SetCurrentContext(p->imGuiContext_); | ||||
| 
 | ||||
|    // Start ImGui Frame
 | ||||
|    ImGui_ImplQt_NewFrame(this); | ||||
|    ImGui_ImplOpenGL3_NewFrame(); | ||||
|    p->ImGuiCheckFonts(); | ||||
|    ImGui::NewFrame(); | ||||
| 
 | ||||
|    // Set default font
 | ||||
|    ImGui::PushFont(defaultFont->font()); | ||||
| 
 | ||||
|    // Perform mouse picking
 | ||||
|    if (p->hasMouse_) | ||||
|    { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 AdenKoperczak
						AdenKoperczak