Jump to content

2.17 - No Fullscreen


photo

Recommended Posts

I have just tested Superposition demo and some C++ API samples and they do not work in fullscreen mode. There are some errors:

WindowManager::WindowManager(): SetProcessDpiAwareness bad result

SystemProxySDL::enableWindowFullscreen(): Can't enable fullscreen mode (display:0 mode:-1)

Log attached.

log.txt

Link to comment

Thank you!

So far we have only a single way of reproducing this behavior (by adjusting process DPI Awareness level).

As I understand correctly, the steps required for this to appear are following:

  1. Download UNIGINE SDK 2.17.x
  2. Download Superposition (or any other demo)
  3. In SDK Browser -> Global Options adjust API to Vulkan, enable fullscreen option, adjust resolution to current desktop resolution (in your case 3840x2160)
  4. Click Apply to confirm the setting
  5. Launch Superposition (or any other demo) from SDK Browser by clicking Run button

Is that correct? Or you actually did something different?

The only case when we observe non-working fullscreen mode and errors in log is when we manually adjust Compatibility settings for the downloaded .exe in it's properties:

image.png

Any option enabled in High DPI scaling override section will lead to non-working fullscreen mode. By default DPI scaling enabled automatically on engine start-up and there is no need to tweak any of these scaling options - Override high DPI scaling checkbox should be disabled.

You can also check with Process Explorer current process DPI Awareness level. Using Process Explorer, Select the View file option menu, and in the drop down menu, select Select Columns… In the window that opens, select DPI Awareness.

If you see Unaware it means that something is overriding default engine behavior (either by modifying compatibility option, or by using external manifest files, or any additional way...):

image.png

Per-Monitor Aware should be the correct value in this tab.

Thanks!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

Steps are correct, but desktop settings should be 3840x2160 150% DPI. With that configuration Unigine can't enter fullscreen mode or displays only part of the image depending on SDK Browser Global Options. Attached images show configurations. When desktop is set to native 3840x2160 100% DPI, unigine enters fullscreen mode correctly, but obviously fonts are too small. You have serious issues with DPI scaling so far. It looks that you either can't enter fullscreen, because there is no such videomode as 4K*150%, or trying to scale the window (or its content) by 150% what results in part of the viewport being cut out.

screen.jpg

screen_desktop_settings.jpg

screen_DX12_3840x2160.jpg

screen_DX12_system.jpg

screen_vulkan_3840x2160.jpg

screen_vulkan_system.jpg

Link to comment

Maybe it depends on Windows version...

Anyway I managed to enter fullscreen mode correctly with the following code. It means that API works correctly and you are doing something else wrong. I noticed that Displays::getDesktopMode() returns -1 at the beginnig and maybe that is why there is this log: "SystemProxySDL::enableWindowFullscreen(): Can't enable fullscreen mode (display:0 mode:-1)". Just guessing...

 

int current_display = Displays::getCurrent();
int desktopMode = Displays::getDesktopMode(current_display);

Log::message("current desktop mode %d\n", desktopMode);

Math::ivec2 desktopResolution;
Math::ivec2 resolution;
int desktopRate;
int rate;

desktopResolution = Displays::getResolution(current_display);
desktopRate = Displays::getRefreshRate(current_display);
Log::message("current resolution %d %d\n", desktopResolution.x, desktopResolution.y);
Log::message("current rate %d\n", desktopRate);

int numModes = Displays::getNumModes(current_display);
int selectedMode = -1;
	
for (int i = 0; i < numModes; i++)
{
	resolution = Displays::getModeResolution(current_display, i);
	rate = Displays::getModeRefreshRate(current_display, i);
	Log::message("supported resolution %d %d %d %d\n", i, resolution.x, resolution.y, rate);

	if (resolution.x == desktopResolution.x && resolution.y == desktopResolution.y && rate == desktopRate)
	{
		selectedMode = i;
	}
}

EngineWindowViewportPtr main_window = WindowManager::getMainWindow();
if (main_window)
{
	if (selectedMode >= 0)
	{
		bool ok = main_window->enableFullscreen(current_display, selectedMode);
		if (ok)
		{
			Log::message("fullscreen set, mode=%d\n", selectedMode);
		}
	}
}

 

fullscreen.jpg

  • Like 1
Link to comment
×
×
  • Create New...