修复gui错误
							parent
							
								
									bca2a1367f
								
							
						
					
					
						commit
						69fc13b883
					
				| 
						 | 
					@ -50,24 +50,15 @@ public:
 | 
				
			||||||
			Font texture loading
 | 
								Font texture loading
 | 
				
			||||||
		*/
 | 
							*/
 | 
				
			||||||
		ImGuiIO& io = ImGui::GetIO();
 | 
							ImGuiIO& io = ImGui::GetIO();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							/// enable keyborad and gamepad input
 | 
				
			||||||
 | 
							io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard;
 | 
				
			||||||
 | 
							io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		unsigned char* fontData;
 | 
							unsigned char* fontData;
 | 
				
			||||||
		int texWidth, texHeight;
 | 
							int texWidth, texHeight;
 | 
				
			||||||
 | 
					 | 
				
			||||||
#if defined(__ANDROID__)
 | 
					 | 
				
			||||||
		float scale = (float)vks::android::screenDensity / (float)ACONFIGURATION_DENSITY_MEDIUM;
 | 
					 | 
				
			||||||
		AAsset* asset = AAssetManager_open(androidApp->activity->assetManager, "Roboto-Medium.ttf", AASSET_MODE_STREAMING);
 | 
					 | 
				
			||||||
		assert(asset);
 | 
					 | 
				
			||||||
		size_t size = AAsset_getLength(asset);
 | 
					 | 
				
			||||||
		assert(size > 0);
 | 
					 | 
				
			||||||
		char *fontAsset = new char[size];
 | 
					 | 
				
			||||||
		AAsset_read(asset, fontAsset, size);
 | 
					 | 
				
			||||||
		AAsset_close(asset);
 | 
					 | 
				
			||||||
		io.Fonts->AddFontFromMemoryTTF(fontAsset, size, 14.0f * scale);
 | 
					 | 
				
			||||||
		delete[] fontAsset;
 | 
					 | 
				
			||||||
#else
 | 
					 | 
				
			||||||
		std::string ttfFilePath = getAssetPath() + "/STXINWEI.TTF";
 | 
							std::string ttfFilePath = getAssetPath() + "/STXINWEI.TTF";
 | 
				
			||||||
		io.Fonts->AddFontFromFileTTF(ttfFilePath.data(), 16.0f,NULL, io.Fonts->GetGlyphRangesChineseSimplifiedCommon());
 | 
							io.Fonts->AddFontFromFileTTF(ttfFilePath.data(), 16.0f,NULL, io.Fonts->GetGlyphRangesChineseSimplifiedCommon());
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
		io.Fonts->GetTexDataAsRGBA32(&fontData, &texWidth, &texHeight);
 | 
							io.Fonts->GetTexDataAsRGBA32(&fontData, &texWidth, &texHeight);
 | 
				
			||||||
		fontTexture.loadFromBuffer(fontData, texWidth * texHeight * 4 * sizeof(char), VK_FORMAT_R8G8B8A8_UNORM, texWidth, texHeight, vulkanDevice, queue);
 | 
							fontTexture.loadFromBuffer(fontData, texWidth * texHeight * 4 * sizeof(char), VK_FORMAT_R8G8B8A8_UNORM, texWidth, texHeight, vulkanDevice, queue);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2080,12 +2080,11 @@ PlumageRender::PlumageRender()
 | 
				
			||||||
		bool updateShaderParams = false;
 | 
							bool updateShaderParams = false;
 | 
				
			||||||
		bool updateCBs = false;
 | 
							bool updateCBs = false;
 | 
				
			||||||
		float scale = 1.0f;
 | 
							float scale = 1.0f;
 | 
				
			||||||
		bool boolTitleWindowShow = false;
 | 
					 | 
				
			||||||
		ImGui::NewFrame();
 | 
							ImGui::NewFrame();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		ImGui::SetNextWindowPos(ImVec2(10000, 10000));
 | 
							ImGui::SetNextWindowPos(ImVec2(10000, 10000));
 | 
				
			||||||
		//ImGui::SetNextWindowSize(ImVec2(200 * scale, (models.scene.animations.size() > 0 ? 440 : 360) * scale), ImGuiSetCond_Always);
 | 
							//ImGui::SetNextWindowSize(ImVec2(200 * scale, (models.scene.animations.size() > 0 ? 440 : 360) * scale), ImGuiSetCond_Always);
 | 
				
			||||||
		ImGui::Begin("", nullptr, ImGuiWindowFlags_NoFocusOnAppearing|ImGuiWindowFlags_AlwaysAutoResize|ImGuiWindowFlags_NoBringToFrontOnFocus);
 | 
							ImGui::Begin(title.c_str(), nullptr, ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoBringToFrontOnFocus);
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
		ImGui::PushItemWidth(100.0f * scale);
 | 
							ImGui::PushItemWidth(100.0f * scale);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2116,6 +2115,7 @@ PlumageRender::PlumageRender()
 | 
				
			||||||
					if (!filename.empty()) {
 | 
										if (!filename.empty()) {
 | 
				
			||||||
						vkDeviceWaitIdle(device);
 | 
											vkDeviceWaitIdle(device);
 | 
				
			||||||
						std::wstring_convert<std::codecvt_utf8<wchar_t>> converter;
 | 
											std::wstring_convert<std::codecvt_utf8<wchar_t>> converter;
 | 
				
			||||||
 | 
											
 | 
				
			||||||
						std::string stringFilename = converter.to_bytes(filename);
 | 
											std::string stringFilename = converter.to_bytes(filename);
 | 
				
			||||||
						loadScene(stringFilename);
 | 
											loadScene(stringFilename);
 | 
				
			||||||
						setupDescriptors();
 | 
											setupDescriptors();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue