Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

maxTextureDimension of 2048 is not enough to go full screen on 3000x2000 resolution laptop #30

Closed
dennisferron opened this issue Nov 17, 2023 · 1 comment

Comments

@dennisferron
Copy link

I encountered this using the step095-emscripten branch configured for native build target, but I assume it affects most of the examples.

My Huawei laptop has a screen resolution of 3000x2000. When I try to go full screen with the application, it has an error. I put an #ifdef to change the requested limits to 4096, except for Emscripten build proper keep at 2048. (This does not prevent going fullscreen from the web version, nevertheless.)

Alternatively perhaps you could detect that the window is about to go above 2048 in a dimension and either pop an informative error message or limit the maximized side of the window.

#ifdef __EMSCRIPTEN__
	// Allow textures up to 2K
	requiredLimits.limits.maxTextureDimension1D = 2048;
	requiredLimits.limits.maxTextureDimension2D = 2048;
#else
	// (My laptop has horizontal resolution of 3000.)
	// Allow textures up to 4K
	requiredLimits.limits.maxTextureDimension1D = 4096;
	requiredLimits.limits.maxTextureDimension2D = 4096;
#endif

@eliemichel
Copy link
Owner

You could indeed use glfwGetMonitors and then glfwGetMonitorWorkarea when initializing WebGPU limits to set them to at least the size of your biggest monitor!

I'll add a note in the "Resizing the window" chapter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants