mirror of
https://github.com/eliasstepanik/imgui-rs.git
synced 2026-01-13 22:48:34 +00:00
and added the thorn in this method
This commit is contained in:
parent
1d15196b5e
commit
41ab364384
@ -10,8 +10,8 @@ use crate::clipboard::{ClipboardBackend, ClipboardContext};
|
||||
use crate::fonts::atlas::{FontAtlas, FontAtlasRefMut, FontId, SharedFontAtlas};
|
||||
use crate::io::Io;
|
||||
use crate::style::Style;
|
||||
use crate::sys;
|
||||
use crate::Ui;
|
||||
use crate::{sys, DrawData};
|
||||
|
||||
/// An imgui-rs context.
|
||||
///
|
||||
@ -518,7 +518,6 @@ impl Context {
|
||||
}
|
||||
|
||||
/// Starts a new frame.
|
||||
#[deprecated(since = "0.9.0", note = "use `new_frame` instead")]
|
||||
pub fn frame(&mut self) -> &mut Ui {
|
||||
self.new_frame()
|
||||
}
|
||||
@ -547,4 +546,17 @@ impl Context {
|
||||
|
||||
&mut self.ui
|
||||
}
|
||||
|
||||
/// Renders the frame and returns a reference to the resulting draw data.
|
||||
///
|
||||
/// This should only be called after calling [`new_frame`].
|
||||
///
|
||||
/// [`new_frame`]: Self::new_frame
|
||||
#[doc(alias = "Render", alias = "GetDrawData")]
|
||||
pub fn render(&mut self) -> &DrawData {
|
||||
unsafe {
|
||||
sys::igRender();
|
||||
&*(sys::igGetDrawData() as *mut DrawData)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -196,28 +196,8 @@ impl Ui {
|
||||
pub fn clone_style(&self) -> Style {
|
||||
unsafe { *self.style() }
|
||||
}
|
||||
// /// Renders the frame and returns a reference to the resulting draw data
|
||||
// #[doc(alias = "Render", alias = "GetDrawData")]
|
||||
// pub fn render(self) -> &DrawData {
|
||||
// unsafe {
|
||||
// sys::igRender();
|
||||
// &*(sys::igGetDrawData() as *mut DrawData)
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
// TODO JACK YOU NEED TO MOVE THIS!
|
||||
// impl Drop for Ui {
|
||||
// #[doc(alias = "EndFrame")]
|
||||
// fn drop(&mut self) {
|
||||
// if !std::thread::panicking() {
|
||||
// unsafe {
|
||||
// sys::igEndFrame();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
/// # Demo, debug, information
|
||||
impl Ui {
|
||||
/// Renders a demo window (previously called a test window), which demonstrates most
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user