Repository navigation
Releases
v0.3.0
Window style and state options for Window and GLWindow, plus a rebuild
against Mojo 1.1.0. No API breaks — existing calls compile and behave as
before — but the compiler floor moves to 1.1.0.
Window options
Window.__init__ and GLWindow.__init__ take three new keyword arguments,
with the same meaning on both:
resizable: Bool = True— allow the user to resize the window. Previously
always on; now it can be turned off for a fixed-size window.borderless: Bool = False— drop the title bar and frame. The window is
still a normal desktop window, so it has no implicit drag or close
behaviour; that is the caller's to provide.maximized: Bool = False— open filling the desktop work area (unlike
fullscreen, which covers the whole display and hides panels). As with
fullscreen, SDL ignores the requested size;width()/height()report
what it actually got, andWindowsizes its pixel buffer to match.
Mojo 1.1.0
Mojo 1.1.0 removes InlineArray from the prelude, replacing it with
Array[T, N]. The event-polling buffers were updated accordingly.
The package ships a precompiled .mojoc, so it now requires
mojo-compiler >=1.1.0,<1.2.0 — the run dependency is pinned to the compiler
minor rather than the major, so the test and consumer environments can no
longer resolve a newer compiler than the one the .mojoc was built with.
This is why the release is a minor bump and not a patch: a consumer still on
Mojo 1.0.0 cannot resolve 0.3.0 at all, and upgrading means inheriting the
same prelude break in their own code. A <0.3 pin will not pick it up
automatically.
Install
[dependencies]
mojo-window = ">=0.3.0"v0.2.0
GL context configuration, fullscreen support, and HiDPI-correct viewport sizing
for GLWindow. No breaking changes — existing code compiles and behaves as
before.
GL context configuration
GLWindow.__init__ takes three new keyword arguments:
core: Bool = True— request a core profile. Previously always requested;
now it can be turned off for drivers that reject a profile mask they would
otherwise accept unset.msaa: Int = 0— multisample sample count, 0 disables. A driver that
refuses the requested count fails context creation rather than silently
degrading; retrying at 0 is the caller's choice.fullscreen: Bool = False— open covering the display. As withWindow,
SDL ignores the requested size;width()/height()report what it got.
New methods
drawable_size() -> Tuple[Int, Int]— backing pixel size, forglViewport.
Under HiDPI or Wayland fractional scaling this differs from
width()/height(), which track the logical size that resize events
report. Using the logical size forglViewportclips or stretches the frame
on a scaled display.set_fullscreen(enabled: Bool)— enter or leave fullscreen after
construction. Size follows asynchronously on some compositors, so read
drawable_size()each frame rather than caching.make_current()— re-assert this window's context as current. The
constructor already does this; needed only when another context (a second
GLWindow, or a library making its own GL calls) may have taken over.
Fixes
- macOS: load
libSDL3.dylibinstead oflibSDL3.so, which madeSDL()
construction fail outright on macOS.
Install
[dependencies]
mojo-window = ">=0.2.0"with https://repo.prefix.dev/modular-community in your channels.
v0.1.1
This small release fixes a crash when creating a fullscreen window. SDL_CreateTexture rejects 0×0 dimensions, and the texture was being created before fullscreen took effect — so the bogus size passed to SDL_CreateWindow was used instead of the actual display resolution.
The fix adds SDL_WINDOW_FULLSCREEN flag and SDL_GetWindowSize so the real display resolution is queried before the texture is allocated.