mirror of
				https://github.com/Zelda64Recomp/Zelda64Recomp.git
				synced 2025-10-30 08:03:03 +00:00 
			
		
		
		
	show display refresh rate in description
This commit is contained in:
		
							parent
							
								
									73ea635f9c
								
							
						
					
					
						commit
						4fef9d9203
					
				
					 6 changed files with 27 additions and 1 deletions
				
			
		|  | @ -283,7 +283,10 @@ | |||
|                         Sets the game's output framerate. This option does not affect gameplay. | ||||
|                         <br /> | ||||
|                         <br /> | ||||
|                         Note: If you have issues with Display mode while using an external frame limiter, use Manual mode instead and configure it to that same frame limit. | ||||
|                         Note: If you have issues with <b>Display</b> mode while using an external frame limiter, use <b>Manual</b> mode instead and configure it to that same frame limit. | ||||
|                         <br /> | ||||
|                         <br /> | ||||
|                         <b>Detected display refresh rate: {{display_refresh_rate}}hz</b> | ||||
|                     </p> | ||||
|                     <p data-if="cur_config_index == 5"> | ||||
|                         Sets the multisample anti-aliasing (MSAA) quality level. This reduces jagged edges in the final image at the expense of rendering performance. | ||||
|  |  | |||
|  | @ -72,6 +72,7 @@ namespace recomp { | |||
| 	void set_cursor_visible(bool visible); | ||||
| 	void update_supported_options(); | ||||
| 	void toggle_fullscreen(); | ||||
| 	void update_rml_display_refresh_rate(); | ||||
| 
 | ||||
| 	extern const std::unordered_map<ButtonVariant, std::string> button_variants; | ||||
| 
 | ||||
|  |  | |||
|  | @ -377,6 +377,17 @@ struct DebugContext { | |||
| 	} | ||||
| }; | ||||
| 
 | ||||
| void recomp::update_rml_display_refresh_rate() { | ||||
| 	static uint32_t lastRate = 0; | ||||
| 	if (!graphics_model_handle) return; | ||||
| 
 | ||||
| 	uint32_t curRate = ultramodern::get_display_refresh_rate(); | ||||
| 	if (curRate != lastRate) { | ||||
| 		graphics_model_handle.DirtyVariable("display_refresh_rate"); | ||||
| 	} | ||||
| 	lastRate = curRate; | ||||
| } | ||||
| 
 | ||||
| DebugContext debug_context; | ||||
| 
 | ||||
| class ConfigMenu : public recomp::MenuController { | ||||
|  | @ -523,6 +534,11 @@ public: | |||
| 				graphics_model_handle.DirtyVariable("ds_info"); | ||||
| 			}); | ||||
| 
 | ||||
| 		constructor.BindFunc("display_refresh_rate", | ||||
| 			[](Rml::Variant& out) { | ||||
| 				out = ultramodern::get_display_refresh_rate(); | ||||
| 			}); | ||||
| 
 | ||||
| 		constructor.BindFunc("options_changed", | ||||
| 			[](Rml::Variant& out) { | ||||
| 				out = (ultramodern::get_graphics_config() != new_options); | ||||
|  |  | |||
|  | @ -956,6 +956,7 @@ struct UIContext { | |||
|         void update_config_menu_loop(bool menu_changed) { | ||||
|             static int prevTab = -1; | ||||
|             if (menu_changed) prevTab = -1; | ||||
|             recomp::update_rml_display_refresh_rate(); | ||||
| 
 | ||||
|             Rml::ElementTabSet *tabset = (Rml::ElementTabSet *)current_document->GetElementById("config_tabset"); | ||||
|             if (tabset == nullptr) return; | ||||
|  |  | |||
|  | @ -292,6 +292,10 @@ uint32_t ultramodern::get_target_framerate(uint32_t original) { | |||
|     } | ||||
| } | ||||
| 
 | ||||
| uint32_t ultramodern::get_display_refresh_rate() { | ||||
|     return display_refresh_rate.load(); | ||||
| } | ||||
| 
 | ||||
| void gfx_thread_func(uint8_t* rdram, std::atomic_flag* thread_ready, ultramodern::WindowHandle window_handle) { | ||||
|     bool enabled_instant_present = false; | ||||
|     using namespace std::chrono_literals; | ||||
|  |  | |||
|  | @ -96,6 +96,7 @@ std::chrono::high_resolution_clock::time_point get_start(); | |||
| std::chrono::high_resolution_clock::duration time_since_start(); | ||||
| void get_window_size(uint32_t& width, uint32_t& height); | ||||
| uint32_t get_target_framerate(uint32_t original); | ||||
| uint32_t get_display_refresh_rate(); | ||||
| void measure_input_latency(); | ||||
| void sleep_milliseconds(uint32_t millis); | ||||
| void sleep_until(const std::chrono::high_resolution_clock::time_point& time_point); | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 thecozies
						thecozies