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

Ability to fetch current frame. #755

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions imgui/src/context.rs
Expand Up @@ -114,6 +114,12 @@ impl Context {
clear_current_context();
SuspendedContext(self)
}
/// Sets current global imgui context, i.e. in a dynamically linked library.
pub fn set_current_context(&self) {
unsafe {
sys::igSetCurrentContext(self.raw);
}
}
/// Returns the path to the ini file, or None if not set
pub fn ini_filename(&self) -> Option<PathBuf> {
let io = self.io();
Expand Down Expand Up @@ -538,6 +544,10 @@ impl Context {
self.new_frame()
}

pub fn current_frame(&mut self) -> &mut Ui {
&mut self.ui
}

/// Starts a new frame and returns an `Ui` instance for constructing a user interface.
#[doc(alias = "NewFame")]
pub fn new_frame(&mut self) -> &mut Ui {
Expand Down