Closed vuki closed 4 years ago
That looks like a silly oversight. I was planning to do a release today, so this should be quick to fix.
EDIT: .. and thanks a lot for reporting this
WindowConfig
is really only supposed to be used for very simple things. You can create your own window, rendering loop, callback function etc if you neeed more control.
Looks like there is no way for WindowConfig
to do fullscreen, but I see no harm in adding this
self._width
and self.width
is really the same thing. The latter is just a property method returning self._width
. I changed it to use the interal properties so it looks less confusing.
New version out : https://pypi.org/project/moderngl-window/2.1.1/
I don't know if it's intentional, but it's not possible to create a fullscreen window without using command line options. I thought that defining
fullscreen = True
in the class would create a fullscreen window, but that's not the case. Here is what happens.fullscreen = True
attribute and I callrun()
of this class.run()
callsmoderngl_window.run_window_config(cls)
wherecls.fullscreen = True
.run_window_config
callswindow_cls
withfullscreen=values.fullscreen
wherevalues
are parsed from the command line and the default value offullscreen
isFalse
.config_cls.fullscreen
is completely ignored.Changing the line 179 in
__init__.py
tofullscreen=config_cls.fullscreen or values.fullscreen,
solves this problem.Also, I think that this code in context/pyglet\window.py is incorrect:
First, screen size is written to
_self._width, self._height
(underscore), then valuesself.width, self.height
(no underscore) are used, discarding the previously calculated values.