pygfx / wgpu-py

WebGPU for Python
https://wgpu-py.readthedocs.io
BSD 2-Clause "Simplified" License
411 stars 33 forks source link

Full-screen mode #451

Open mikeny07 opened 9 months ago

mikeny07 commented 9 months ago

Is it possible to run pygfx applications in a full-screen mode without the top "title" bar?

Korijn commented 9 months ago

No. We'll have to add support for it here in the wgpu.gui subpackage.

almarklein commented 9 months ago

Actually ... this works:

import PySide6
from wgpu.gui.qt import WgpuCanvas, run
import pygfx as gfx

canvas = WgpuCanvas(size=(900, 400))
canvas.showFullScreen()
renderer = gfx.renderers.WgpuRenderer(canvas)

... etc

And for glfw:

canvas = WgpuCanvas(size=(900, 400))

import glfw

glfw.set_window_monitor(canvas._window, glfw.get_primary_monitor(), 0, 0, 1920, 1080, glfw.DONT_CARE)
...

Would be nice to support WgpuCanvas(... fullscreen=True), but until then, you can use something like the above.

Korijn commented 9 months ago

Would be nice to support WgpuCanvas(... fullscreen=True), but until then, you can use something like the above.

Let's use this issue to track the API changes we would propose.

I guess it would also require some method to get a list of monitors?

almarklein commented 9 months ago

I guess it would also require some method to get a list of monitors?

I think it can default to the default / current screen. Qt's showFullScreen has no args to specify a monitor.

This might be a good time to also consider other window states: normal (windowed), hidden, minimized, maximixed, fullscreen.

mikeny07 commented 9 months ago

Great, the glfw.set_window_monitor function works.

It would be nice to allow the user to set the full-screen mode.

Thank you so much for your excellent work!

hmaarrfk commented 5 months ago

Are you really trying to abstract away Qt and GLFW. Why not just document your short examples.

I strongly doubt any code beyond simple examples can be made to run agnosticqlly between the two

Korijn commented 5 months ago

Are you really trying to abstract away Qt and GLFW. Why not just document your short examples.

I strongly doubt any code beyond simple examples can be made to run agnosticqlly between the two

Well, this is a pretty deep topic.

Hope that explains.