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

Full-screen mode #451

Open
mikeny07 opened this issue Dec 17, 2023 · 7 comments
Open

Full-screen mode #451

mikeny07 opened this issue Dec 17, 2023 · 7 comments

Comments

@mikeny07
Copy link

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

@Korijn Korijn transferred this issue from pygfx/pygfx Dec 17, 2023
@Korijn
Copy link
Collaborator

Korijn commented Dec 17, 2023

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

@almarklein
Copy link
Member

almarklein commented Dec 18, 2023

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
Copy link
Collaborator

Korijn commented Dec 18, 2023

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.

  • WgpuCanvas(..., fullscreen=True)
  • WgpuCanvas().fullscreen(monitor: int=None, windowless: bool=False) to switch at runtime
  • WgpuCanvas().windowed() to switch at runtime

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

@almarklein
Copy link
Member

almarklein commented Dec 19, 2023

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
Copy link
Author

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
Copy link
Contributor

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
Copy link
Collaborator

Korijn commented Mar 31, 2024

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.

  • wgpu.gui already abstracts over glfw, qt, wx, offscreen and jupyter
  • it's intended to make it very easy to visualize something quickly
  • it's not as outlandish as you may think, e.g. matplotlib does exactly the same thing
  • we strive to make usage of the wgpu.gui subpackage entirely optional, so you can use it for simple scripts and applications as you like
  • but you're never required to use it

Hope that explains.

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

4 participants