dear-imgui-glow
Glow (OpenGL) renderer for Dear ImGui.
Quick Start
use Context;
use GlowRenderer;
use HasContext;
let gl = unsafe ;
let mut imgui = create;
let mut renderer = new?;
// per-frame
let draw_data = imgui.render;
renderer.new_frame?;
renderer.render?;
What You Get
- ImGui v1.92 texture system integration (font atlas upload + dynamic texture updates)
- OpenGL 2.1+/ES 2.0+ compatible shaders and state setup
- Full GL state backup/restore around ImGui rendering
sRGB / Gamma
-
Pipeline choice
- Linear FB: keep
FRAMEBUFFER_SRGBdisabled (default). Colors are passed through without gamma. - sRGB FB: request an sRGB-capable surface and enable
FRAMEBUFFER_SRGB.renderer.set_framebuffer_srgb_enabled // enabled during render, disabled after - Pick exactly one path to avoid double correction.
- Linear FB: keep
-
Vertex color gamma (auto + override)
- The renderer applies gamma to ImGui vertex colors in the fragment shader via a
ColorGammauniform. - Auto (default):
2.2whenFRAMEBUFFER_SRGBis enabled (decode vertex colors from sRGB → linear before write)1.0whenFRAMEBUFFER_SRGBis disabled (pass-through)
- Override if needed:
// Force a custom gamma (e.g., 2.2 or 1.0). Use None to restore auto. renderer.set_color_gamma_override; renderer.set_color_gamma_override;
- The renderer applies gamma to ImGui vertex colors in the fragment shader via a
-
Clear color
gl.clear_color(r,g,b,a)is specified in linear space. With sRGB FB, the driver encodes it on write, so the on-screen hex may not equalr,g,b * 255exactly (this is expected).
Notes
- Alpha8 textures currently expand to RGBA8 for broad compatibility. On GL 3.3+/GLES 3.0+, RED + texture swizzle can reduce memory (see code comments).
- Multi-viewport support is feature-gated (off by default).
Compatibility
| Item | Version |
|---|---|
| Crate | 0.10.x |
| dear-imgui-rs | 0.10.x |
| glow | 0.16 |
See also: docs/COMPATIBILITY.md for the full workspace matrix.
Features
- Default (core):
bind_vertex_array_support,vertex_offset_support - Extras (opt-in as a group): enable
extrasto includegl_extensions_support,bind_sampler_support,clip_origin_support,polygon_mode_support,primitive_restart_support - Debug helper:
debug_message_insert_support(no-op if disabled) - Multi-viewport:
multi-viewport(declared but currently not fully supported; off by default)
Rule of thumb: use the defaults; turn on extras only if you need those GL knobs.