Skip to content

Commit eb33a0e

Browse files
committed
fix(samples): waive glInteropMipmapLod when the pyglet window cannot open
Match glInteropFluid and glInteropPlasma so a failure to open the pyglet window is a sample waiver.
1 parent 5fe0749 commit eb33a0e

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎samples/cuda_core/glInteropMipmapLod/glInteropMipmapLod.py‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,11 @@ def main(argv=None):
463463
)
464464

465465
# --- Step 4: Open a window and set up the GL/CUDA bridge ---
466-
window, gl, pyglet = create_window()
466+
try:
467+
window, gl, pyglet = create_window()
468+
except Exception as exc:
469+
print(f"Could not open a pyglet window ({exc}); waiving glInteropMipmapLod.", file=sys.stderr)
470+
sys.exit(EXIT_WAIVED)
467471
shader_prog, quad_vao, tex_id = create_display_resources(gl, WIDTH, HEIGHT)
468472
pbo_id, _ = create_pixel_buffer(gl, WIDTH, HEIGHT)
469473
resource = GraphicsResource.from_gl_buffer(pbo_id, flags="write_discard")

0 commit comments

Comments
 (0)