Skip to content

ImGuiIntegration: make ImFontAtlas texture accessible - #61

Closed
rune-scape wants to merge 2 commits into
mosra:masterfrom
rune-scape:accessible-atlas-texture
Closed

rune-scape wants to merge 2 commits into
mosra:masterfrom
rune-scape:accessible-atlas-texture

Conversation

@rune-scape

Copy link
Copy Markdown
Contributor

Fixes #60

@codecov-io

codecov-io commented Dec 31, 2019 •

Copy link
Copy Markdown

Codecov Report

Merging #61 into master will decrease coverage by 0.57%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #61      +/-   ##
==========================================
- Coverage   74.55%   73.97%   -0.58%     
==========================================
  Files          21       21              
  Lines         900      903       +3     
==========================================
- Hits          671      668       -3     
- Misses        229      235       +6
Impacted Files Coverage Δ
src/Magnum/ImGuiIntegration/Context.h 100% <ø> (ø) ⬆️
src/Magnum/ImGuiIntegration/Context.cpp 82.28% <66.66%> (-0.86%) ⬇️
src/Magnum/DartIntegration/ConvertShapeNode.cpp 93.92% <0%> (-2.21%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 43e86c2...d66065c. Read the comment docs.

@mosra mosra left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thank you (and extra thanks for writing the docs as well 👍).

One more thing -- could you do simplify the ternary condition we talked about? You mentioned it worked well in your last comment in #60. (To be extra sure, if you could test that also an ImGuiIntegration::image() widget still work as expected after that change, that'd be great.)

Comment thread src/Magnum/ImGuiIntegration/Context.h Outdated
*
* @return Reference to the @cpp GL::Texture2D @ce in @cpp ImFontAtlas @ce
*/
GL::Texture2D& getAtlasTexture();

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Could this be just atlasTexture()? Magnum doesn't use get prefixes anywhere else.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes, my bad

@mosra mosra added this to the 2019.1c milestone Jan 2, 2020
@mosra

mosra commented Jan 3, 2020

Copy link
Copy Markdown
Owner

Merged as b3c65b9, thank you! :)

@rune-scape

Copy link
Copy Markdown
Contributor Author

btw i have been testing with the ternary statement simplified, and everything works

@Squareys

Squareys commented Jan 5, 2020 •

Copy link
Copy Markdown
Contributor

There is a tiny bug in here:

When the Context is moved, the pointer to _texture is invalidated so that the ImGui font TexID points to invalid memory. The TexID needs to be updated in Context(Context&&).

I will follow up with a tiny PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

ImFontAtlas::TexID remains unset after a call to ImGuiIntegration::Context::relayout

4 participants