We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I would like to customize context creation for moderngl.
The current workaround is to hack on the create context function.
import moderngl_window as mglw import moderngl moderngl.create_context = ... mglw.BaseWindow.init_mgl_context = ...
Is there any way to customize context creation from a WindowConfig?
class Example(mglw.WindowConfig): gl_version = (3, 3) title = "ModernGL Example" window_size = (1280, 720) aspect_ratio = 16 / 9 resizable = True resource_dir = os.path.normpath(os.path.join(__file__, '../data')) # something like: def init_mgl_context(self): ... # or similar
The text was updated successfully, but these errors were encountered:
Hello! All WindowConfig methods are described here: https://moderngl-window.readthedocs.io/en/latest/reference/context/windowconfig.html
init_mgl_context() is available in BaseWindow and other window configurations: https://moderngl-window.readthedocs.io/en/latest/reference/context/basewindow.html
init_mgl_context()
Next to each method there is a [source] button, which allows you to view an example of creating a similar method.
Sorry, something went wrong.
Taking any ideas for making this less hacky.
Monkey-patching the BaseWindow.init_mgl_context() definitely seems to be the laziest solution here.
BaseWindow.init_mgl_context()
Will keep this open in case better ideas turn up.
No branches or pull requests
I would like to customize context creation for moderngl.
The current workaround is to hack on the create context function.
Is there any way to customize context creation from a WindowConfig?
The text was updated successfully, but these errors were encountered: