mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-30 20:21:12 -06:00 
			
		
		
		
	ENH: add protect logic in post_init to check opengl resource
when the opengl context not ready postpone the GLCanvas3D's init Change-Id: I68b9d70f08e4ba0076a64aca59612a3f613070ff (cherry picked from commit 446a384dcc74af8184ee0a1af6668626d13413e9)
This commit is contained in:
		
							parent
							
								
									1cb64c15a0
								
							
						
					
					
						commit
						67d95d3fc8
					
				
					 1 changed files with 10 additions and 7 deletions
				
			
		|  | @ -1000,7 +1000,7 @@ void GUI_App::post_init() | |||
|         BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(", init with input files, size %1%, input_gcode %2%") | ||||
|             %this->init_params->input_files.size() %this->init_params->input_gcode; | ||||
| 
 | ||||
|          | ||||
| 
 | ||||
| 
 | ||||
|         if (this->init_params->input_files.size() == 1 && | ||||
|             boost::starts_with(this->init_params->input_files.front(), "bambustudio://open")) { | ||||
|  | @ -1054,9 +1054,9 @@ void GUI_App::post_init() | |||
|         mainframe->select_tab(size_t(MainFrame::tp3DEditor)); | ||||
|         plater_->select_view_3D("3D"); | ||||
|         //BBS init the opengl resource here
 | ||||
| #ifdef __linux__ | ||||
| //#ifdef __linux__
 | ||||
|         if (plater_->canvas3D()->get_wxglcanvas()->IsShownOnScreen()&&plater_->canvas3D()->make_current_for_postinit()) { | ||||
| #endif | ||||
| //#endif
 | ||||
|             Size canvas_size = plater_->canvas3D()->get_canvas_size(); | ||||
|             wxGetApp().imgui()->set_display_size(static_cast<float>(canvas_size.get_width()), static_cast<float>(canvas_size.get_height())); | ||||
|             BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ", start to init opengl"; | ||||
|  | @ -1076,9 +1076,12 @@ void GUI_App::post_init() | |||
|                 plater_->canvas3D()->render(false); | ||||
|                 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ", finished rendering a first frame for test"; | ||||
|             } | ||||
| #ifdef __linux__ | ||||
| //#ifdef __linux__
 | ||||
|         } | ||||
| #endif | ||||
|         else { | ||||
|             BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << "Found glcontext not ready, postpone the init"; | ||||
|         } | ||||
| //#endif
 | ||||
|         if (is_editor()) | ||||
|             mainframe->select_tab(size_t(0)); | ||||
|         mainframe->Thaw(); | ||||
|  | @ -5701,7 +5704,7 @@ void GUI_App::open_mall_page_dialog() | |||
|     host_url = get_model_http_url(app_config->get_country_code()); | ||||
| 
 | ||||
|     //model url
 | ||||
|      | ||||
| 
 | ||||
|     wxString language_code = this->current_language_code().BeforeFirst('_'); | ||||
|     model_url = language_code.ToStdString(); | ||||
| 
 | ||||
|  | @ -5715,7 +5718,7 @@ void GUI_App::open_mall_page_dialog() | |||
|             if(result == 0){ | ||||
|                 link_url = host_url + "api/sign-in/ticket?to=" + host_url + url_encode(model_url) + "&ticket=" + ticket; | ||||
|             } | ||||
|         }  | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     if (result < 0) { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 lane.wei
						lane.wei