Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

dbr
Copy link
Contributor

@dbr dbr commented May 28, 2022

Closes #643

(cc @Selicre @jmaargh )

Prevents leak if set_up_render_state is called without calling render

Closes imgui-rs#643
Copy link

@jmaargh jmaargh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a suggested change to the docs, but otherwise LGTM

Comment on lines 6 to 10
//! It is important to note this renderer's API is not foolproof. It was designed
//! more for simplicity and control (allowing the user to manually have some control
//! over the GL state) than as a production-ready fully-general API. This control is
//! why so many things are `pub`.
//!
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest removing this and instead extending the "Scope" section of the docs to something like this:

//! 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" funcitons are marked `pub` to allow the user more
//! fine-grained control at the cost of potential rendering errors.

Copy link
Member

@thomcc thomcc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. It's weird to create/delete the VAO every frame but it makes sense for debug UI like imgui to avoid relying on too much external state.

@thomcc thomcc merged commit 1de842a into imgui-rs:main May 31, 2022
@jmaargh
Copy link

jmaargh commented Jun 1, 2022

@thomcc As well as simplifying shared-state management, the upstream example notes that this allows the renderer to work across multiple OpenGL contexts

@dbr dbr deleted the glow-vbo-leak branch January 11, 2023 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ResetRenderState memory leak in glow-renderer
3 participants