--- id: moderngl-window version: "3.1.1" license: unclear license_treatment: permissive maintenance: active --- # moderngl-window — A cross platform helper library for ModernGL making window creation and resource loading simple License: permissive · Maintenance: active · Downloads: 216.3K/mo ## What it is and what it does moderngl-window is a cross-platform utility library that abstracts away the complexity of setting up OpenGL windows and loading graphics resources. It sits on top of ModernGL and provides a unified interface for creating windows using your choice of backend (pyglet, pygame, GLFW, SDL2, PySide2, PyQt5, or tkinter), handling keyboard and mouse events consistently across platforms. The library also bundles loaders for 2D textures, texture arrays, cube maps, GLSL shaders, and 3D models in OBJ, GLTF 2.0, and STL formats. The design emphasizes flexibility: you can use the simple WindowConfig class to get started immediately, or drop down to lower-level APIs for fine-grained control. It depends on moderngl for the core rendering, pyglet for windowing, numpy and pyglm for math operations, and Pillow for image loading. The package is actively maintained, supports Python 3.9 and later, and has been tested on Windows, Linux, and macOS. Use it for: - Build a cross-platform 3D visualization tool that works identically on Windows, Linux, and macOS without rewriting window code. - Prototype interactive graphics applications using ModernGL without manually handling platform-specific windowing details. - Load and render 3D models and textures from common formats (OBJ, GLTF, STL, PNG, JPEG) with minimal boilerplate. - Create educational graphics demos or scientific visualizations that need consistent event handling across multiple windowing systems. - Develop games or interactive applications using a pluggable architecture that lets you swap windowing backends at runtime. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. moderngl-window simplifies OpenGL window creation and resource loading across Windows, Linux, and macOS by wrapping ModernGL with support for multiple windowing backends and built-in loaders for textures, shaders, and 3D models. Yes. The package is actively maintained, has no known vulnerabilities, installs with low friction, and solves a genuine cross-platform pain point for OpenGL development. It is well-suited for anyone building 3D graphics applications with ModernGL who wants to avoid reimplementing window management and resource loading for each platform. ## Install pip install moderngl-window uv add moderngl-window poetry add moderngl-window ## Installing moderngl-window Before you install: Low install friction with a pure-Python wheel distribution. The package is actively maintained with a recent commit on 2026-07-11 and draws on five runtime dependencies (moderngl, pyglet, numpy, pyglm, Pillow) that are themselves well-established. License in practice: Licensed under the MIT License (permissive), allowing use in commercial and private projects with minimal restrictions. Quickstart: pip install moderngl-window import moderngl_window as mglw class Test(mglw.WindowConfig): gl_version = (3, 3) def on_render(self, time: float, frametime: float): self.ctx.clear(1.0, 0.0, 0.0, 0.0) Test.run() Requires a working OpenGL context; windowing backend (pyglet, pygame, GLFW, SDL2, PySide2, PyQt5, or tkinter) must be installed separately or specified at runtime. Verify before relying: - Whether all advertised windowing backends (pygame, GLFW, SDL2, PySide2, PyQt5, tkinter) are included as optional dependencies or must be installed separately. - Performance characteristics and typical use cases for large-scale 3D scene rendering or real-time graphics applications. ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 216.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags opengl window creation cross-platform, moderngl utility library, 3d graphics window setup, shader and texture loading, cross-platform opengl rendering, opengl, 3d-graphics, cross-platform [View on SkillFed](https://skillfed.io/packages/moderngl-window) · [View on PyPI](https://pypi.org/project/moderngl-window/)