Expand description
Glow (OpenGL) renderer for Dear ImGui
This crate provides a Glow-based renderer for Dear ImGui, allowing you to render Dear ImGui interfaces using the Glow OpenGL abstraction.
§Features
- Basic rendering: Render Dear ImGui draw data using OpenGL
- Texture support: Handle font textures and user textures
- Multi-viewport support: Support for multiple windows (feature-gated)
- OpenGL compatibility: Support for OpenGL 2.1+ and OpenGL ES 2.0+
§Example
use dear_imgui_rs::Context;
use dear_imgui_glow::GlowRenderer;
use glow::HasContext;
// Initialize your OpenGL context and Dear ImGui context
let gl = unsafe { glow::Context::from_loader_function(|s| {
// Your OpenGL loader function
std::ptr::null()
}) };
let mut imgui = Context::create();
// Create the renderer (simple usage)
let mut renderer = GlowRenderer::new(gl, &mut imgui).unwrap();
// In your render loop:
// imgui.new_frame();
// ... build your UI ...
// let draw_data = imgui.render();
// renderer.render(draw_data).unwrap();Re-exports§
pub use glow;
Structs§
- GlVersion
- OpenGL version information
- Glow
Renderer - Main renderer for Dear ImGui using Glow (OpenGL)
- Glsl
Version - GLSL version information
- Simple
Texture Map - Simple texture map implementation using a HashMap with modern texture management
Enums§
- Init
Error - Errors that can occur during renderer initialization
- Render
Error - Errors that can occur during rendering
Traits§
- Texture
Map - Trait for managing texture mappings with modern Dear ImGui texture system
Functions§
- create_
texture_ from_ alpha - Create a texture from raw alpha data (single channel)
- create_
texture_ from_ rgba - Create a texture from raw RGBA data
- update_
imgui_ texture - Update texture from ImGui texture data (similar to ImGui_ImplOpenGL3_UpdateTexture)
- update_
texture - Update a texture with new data
Type Aliases§
- GlBuffer
- GlProgram
- GlTexture
- GlUniform
Location - GlVertex
Array - Init
Result - Result type for initialization operations
- Render
Result - Result type for rendering operations