rust_minifb icon indicating copy to clipboard operation
rust_minifb copied to clipboard

fullscreen windows

Open aeosynth opened this issue 7 years ago • 8 comments
trafficstars

Hi, I'd like to make windows fullscreen, thanks. I suppose currently I could manually get the screen size and set the image to that.

aeosynth avatar Feb 22 '18 10:02 aeosynth

Hi, Currently there is no support for fullscreen no.

emoon avatar Feb 22 '18 10:02 emoon

Is there anything specific preventing it currently?

SuperCuber avatar May 08 '18 18:05 SuperCuber

It depends a bit on how you want to implement it. There are two ways I see doing it

  1. Switch the resolution of the monitor. This is what games do, and yields better performance.
  2. Scale the screen to fit the current screen resolution.

Both of the above requires correct aspect ratio handling for the screen to look correct. Also it the style of window needs to be changed as well (so no title is shown etc)

So while there is nothing really preventing it it's a bunch of work to support on all platforms as the APIs for each platform is different and currently macOS, Linux, Windows and Redox is supported.

emoon avatar May 08 '18 18:05 emoon

With all backends (except Redox perhaps) having (or soon having) GPU support adding fullscreen is a bit easier. I think what would work is just to create a top most window and the desktop size. This will tax the GPU a bit more for sure but wouldn't require changing the desktop resolution which sometimes has bad side effects (things moving around and not back to correct place and such)

Will this be fine?

emoon avatar Sep 12 '19 14:09 emoon

i no longer need this

aeosynth avatar Sep 12 '19 23:09 aeosynth

I'm not exactly sure what you mean by create a top most window and the desktop size, but most games and windowing libraries provide a "true fullscreen" option which changes the monitor's resolution and also a "borderless maximized" option which is just removing all decorations and scaling the window up to the monitor's size

SuperCuber avatar Sep 13 '19 05:09 SuperCuber

Yes but because minifb just renderes one fullscreen quad pretty much all GPUs can do that at full speed for your desktop resolution. So instead of actually changing the desktop resolution it would render a borderless maximized window at the current desktop res.

emoon avatar Sep 19 '19 09:09 emoon

@emoon AFAIK Fullscreen mode is used to prevent compositing and thus reduce latency. So in my opinion this feature should be considered to be implemented.

nyovaya avatar Apr 23 '20 12:04 nyovaya