#opengl #imgui #renderer #glow #render #basic #imgui-rs

imgui-glow-renderer

glow renderer for the imgui crate

9 releases (5 breaking)

0.13.0 Sep 30, 2024
0.12.0 May 5, 2024
0.11.0 Apr 5, 2023
0.10.0 Jan 16, 2023
0.8.0 Sep 17, 2021

#106 in Rendering

Download history 301/week @ 2024-07-17 282/week @ 2024-07-24 232/week @ 2024-07-31 220/week @ 2024-08-07 242/week @ 2024-08-14 335/week @ 2024-08-21 454/week @ 2024-08-28 335/week @ 2024-09-04 281/week @ 2024-09-11 305/week @ 2024-09-18 418/week @ 2024-09-25 474/week @ 2024-10-02 321/week @ 2024-10-09 450/week @ 2024-10-16 337/week @ 2024-10-23 226/week @ 2024-10-30

1,379 downloads per month
Used in imgui-sdl2-support

MIT/Apache

550KB
1K SLoC

imgui-glow-renderer

Renderer for [imgui-rs][imgui] using the glow library for OpenGL.

This is heavily influenced by the example from upstream.

Basic usage

A few code examples are provided in the source.

In short, create either an AutoRenderer (for basic usage) or Renderer for slightly more customizable operation, then call the render(...) method with draw data from imgui.

OpenGL (ES) versions

This renderer is expected to work with OpenGL version 3.3 and above, and OpenGL ES version 3.0 or above. This should cover the vast majority of even fairly dated hardware. Please submit an issue for any incompatibilities found with these OpenGL versions, pull requests to extend support to earlier versions are welcomed.

Scope

Consider this an example renderer. It is intended to be sufficent for simple applications running imgui-rs as the final rendering step. If your application has more specific needs, it's probably best to write your own renderer, in which case this can be a useful starting point. This renderer is also not foolproof (largely due to the global nature of the OpenGL state). For example, a few "internal" functions are marked pub to allow the user more fine-grained control at the cost of allowing potential rendering errors.

sRGB

When outputting colors to a screen, colors need to be converted from a linear color space to a non-linear space matching the monitor (e.g. sRGB). When using the AutoRenderer, this library will convert colors to sRGB as a step in the shader. When initialising a Renderer, you can choose whether or not to include this step in the shader or not when calling Renderer::initialize.

This library also assumes that textures have their internal format set appropriately when uploaded to OpenGL. That is, assuming your texture is sRGB (if you don't know, it probably is) the internal_format is one of the SRGB* values.

License

Licensed under either of

at your option.

Dependencies

~14–21MB
~319K SLoC