diff --git a/imgui-glow-renderer/src/lib.rs b/imgui-glow-renderer/src/lib.rs index f6d1814..e35e5ce 100644 --- a/imgui-glow-renderer/src/lib.rs +++ b/imgui-glow-renderer/src/lib.rs @@ -1,4 +1,4 @@ -//! Renderer for `[imgui-rs]` using the `[glow]` library for OpenGL. +//! Renderer for [`imgui-rs`][imgui] using the [`glow`] library for OpenGL. //! //! This is heavily influenced by the //! [example from upstream](https://github.com/ocornut/imgui/blob/fe245914114588f272b0924538fdd43f6c127a26/backends/imgui_impl_opengl3.cpp). @@ -7,9 +7,9 @@ //! //! A few code examples are provided in the source. //! -//! In short, create either an `[AutoRenderer]` (for basic usage) or `[Renderer]` +//! 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-rs`. +//! method with draw data from [`imgui`]. //! //! # OpenGL (ES) versions //! @@ -30,10 +30,10 @@ //! //! 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 +//! 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]`. +//! [`Renderer::initialize`]. //! //! This library also assumes that textures have their internal format //! set appropriately when uploaded to OpenGL. That is, assuming your texture @@ -57,11 +57,11 @@ type GlUniformLocation = ::Program; /// Renderer which owns the OpenGL context and handles textures itself. Also /// converts all output colors to sRGB for display. Useful for simple applications, -/// but more complicated applications may prefer to use `[Renderer]`, or even +/// but more complicated applications may prefer to use [`Renderer`], or even /// write their own renderer based on this code. /// /// OpenGL context is still available to the rest of the application through -/// the `[gl_context]` method. +/// the [`gl_context`](Self::gl_context) method. pub struct AutoRenderer { gl: glow::Context, texture_map: SimpleTextureMap, @@ -86,7 +86,7 @@ impl AutoRenderer { } /// Note: no need to provide a `mut` version of this, as all methods on - /// `[glow::HasContext]` are immutable. + /// [`glow::HasContext`] are immutable. #[inline] pub fn gl_context(&self) -> &glow::Context { &self.gl @@ -534,11 +534,15 @@ impl Renderer { /// Trait for mapping imgui texture IDs to OpenGL textures. /// -/// `[register]` should be called after uploading a texture to OpenGL to get a -/// `[imgui::TextureId]` corresponding to it. +/// [`register`] should be called after uploading a texture to OpenGL to get a +/// [`imgui::TextureId`] corresponding to it. /// -/// Then `[gl_texture]` can be called to find the OpenGL texture corresponding to -/// that `[imgui::TextureId]`. +/// [`register`]: Self::register +/// +/// Then [`gl_texture`] can be called to find the OpenGL texture corresponding to +/// that [`imgui::TextureId`]. +/// +/// [`gl_texture`]: Self::gl_texture pub trait TextureMap { fn register(&mut self, gl_texture: GlTexture) -> Option; @@ -563,7 +567,7 @@ impl TextureMap for SimpleTextureMap { } } -/// `[imgui::Textures]` is a simple choice for a texture map. +/// [`imgui::Textures`] is a simple choice for a texture map. impl TextureMap for imgui::Textures { fn register(&mut self, gl_texture: glow::Texture) -> Option { Some(self.insert(gl_texture))