DisplayServer (Windows): support precise refresh rate

This commit is contained in:
李通洲
2023-03-22 14:59:24 +08:00
parent b3da6b0e89
commit dcd0f8d3f6
8 changed files with 68 additions and 49 deletions
+2 -2
View File
@@ -25,7 +25,7 @@ void ffPrintDisplay(FFinstance* instance)
printf("%ix%i", result->width, result->height);
if(result->refreshRate > 0)
printf(" @ %iHz", result->refreshRate);
printf(" @ %iHz", (uint32_t) (result->refreshRate + 0.5));
if(
result->scaledWidth > 0 && result->scaledWidth != result->width &&
@@ -39,7 +39,7 @@ void ffPrintDisplay(FFinstance* instance)
ffPrintFormat(instance, FF_RESOLUTION_MODULE_NAME, moduleIndex, &instance->config.display, FF_RESOLUTION_NUM_FORMAT_ARGS, (FFformatarg[]) {
{FF_FORMAT_ARG_TYPE_UINT, &result->width},
{FF_FORMAT_ARG_TYPE_UINT, &result->height},
{FF_FORMAT_ARG_TYPE_UINT, &result->refreshRate},
{FF_FORMAT_ARG_TYPE_DOUBLE, &result->refreshRate},
{FF_FORMAT_ARG_TYPE_UINT, &result->scaledWidth},
{FF_FORMAT_ARG_TYPE_UINT, &result->scaledHeight}
});