Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor WindowDrawList into DrawListMut and fix #413. #414

Merged
merged 1 commit into from Jan 1, 2021

Conversation

nsf
Copy link
Contributor

@nsf nsf commented Dec 28, 2020

  • Rename WindowDrawList -> DrawListMut. It's not about window draw lists, but
    about background/foreground draw lists as well. The naming was not an easy
    choice, but seems like in rust it's a common convention to add a Mut suffix for
    mutable entities. Imgui-rs already has DrawList and it acts as an immutable
    reference type for rendering implementations to consume. Hence the name
    DrawListMut, which becomes a mutable reference to draw list with methods
    to modify it.
  • Add Ui::get_foreground_draw_list(). Same as Ui::get_background_draw_list()
    but for foreground.
  • Add draw_list example which shows the use of all three draw lists
    (window, bg, fg).

- Rename WindowDrawList -> DrawListMut. It's not about window draw lists, but
  about background/foreground draw lists as well. The naming was not an easy
  choice, but seems like in rust it's a common convention to add a Mut suffix for
  mutable entities. Imgui-rs already has DrawList and it acts as an immutable
  reference type for rendering implementations to consume. Hence the name
  DrawListMut, which becomes a mutable reference to draw list with methods
  to modify it.
- Add Ui::get_foreground_draw_list(). Same as Ui::get_background_draw_list()
  but for foreground.
- Add draw_list example which shows the use of all three draw lists
  (window, bg, fg).
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 great. It will be a bit until I can merge it since I'd like to check the example on different platforms first but overall very nice.

@thomcc
Copy link
Member

thomcc commented Dec 31, 2020

Sorry for the delay here, I finally have some time to test stuff today.

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 is great, and works great. Thanks a ton. I don't know when this will be in a release but probably relatively soon.

I'll try and remember to make a comment when 0.7 is cut.

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.

None yet

2 participants