Registry / other / glutin

glutin

JSON →
library0.32.3rscratesunverified

Cross-platform OpenGL context provider for windowing systems.

# Cargo.toml [dependencies] glutin = "0.32.3"
INSTALL
IMPORT
SIG · GLUTIN
G
glutin
otherrustv0.32.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ConfigTemplateBuilder
use glutin::config::ConfigTemplateBuilder;

Creates an OpenGL context with a window.

use glutin::config::{ConfigTemplateBuilder, GlConfig}; use glutin::display::GetGlDisplay; use glutin::prelude::*; fn main() -> Result<(), Box<dyn std::error::Error>> { let event_loop = glutin::event_loop::EventLoop::new(); let window = glutin::window::WindowBuilder::new().build(&event_loop)?; let gl_config = unsafe { glutin::config::ConfigTemplateBuilder::new() .build() .unwrap() .choose(&event_loop) .unwrap() }; let gl_context = unsafe { gl_config.display().create_context(&gl_config, &Default::default())? }; println!("OpenGL context created"); Ok(()) }
Debug
Known issues
gotchaGlutin requires an active event loop and window; context creation is unsafe and platform-specific.
fix
Ensure you have a running event loop and handle platform-specific initialization (e.g., X11, Wayland).
affects: >=0.32.0
Upgrade
Version history
0.32.3latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
12
Meta
1
Resources