mirror of
https://github.com/eliasstepanik/imgui-rs.git
synced 2026-01-11 13:38:35 +00:00
Move to virtual workspace
This commit is contained in:
parent
413ecc05a0
commit
0df089ab29
50
.github/workflows/ci.yml
vendored
50
.github/workflows/ci.yml
vendored
@ -31,30 +31,20 @@ jobs:
|
|||||||
path: |
|
path: |
|
||||||
~/.cargo/registry
|
~/.cargo/registry
|
||||||
~/.cargo/git
|
~/.cargo/git
|
||||||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}-${{ hashFiles('**/Cargo.lock') }}
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}-
|
${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
|
||||||
${{ runner.os }}-cargo-
|
${{ runner.os }}-cargo-
|
||||||
- name: Cache cargo target dirs
|
- name: Cache cargo target dirs
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: |
|
path: target
|
||||||
target
|
key: ${{ runner.os }}-target-lint-stable-${{ hashFiles('**/Cargo.toml') }}
|
||||||
imgui-examples/target
|
|
||||||
imgui-gfx-examples/target
|
|
||||||
imgui-sys-bindgen/target
|
|
||||||
key: ${{ runner.os }}-target-lint-stable-${{ hashFiles('**/Cargo.toml') }}-${{ hashFiles('**/Cargo.lock') }}
|
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-target-lint-stable-${{ hashFiles('**/Cargo.toml') }}-
|
${{ runner.os }}-target-lint-stable-${{ hashFiles('**/Cargo.toml') }}
|
||||||
${{ runner.os }}-target-lint-stable-
|
${{ runner.os }}-target-lint-stable-
|
||||||
${{ runner.os }}-target-lint-
|
${{ runner.os }}-target-lint-
|
||||||
${{ runner.os }}-target-
|
|
||||||
- run: cargo clippy --workspace --all-targets
|
- run: cargo clippy --workspace --all-targets
|
||||||
# excluded crates
|
|
||||||
# ... why do only these two have lockfiles? Oh well, keep them up to date if they're in there...
|
|
||||||
- run: cargo clippy --manifest-path imgui-examples/Cargo.toml --all-targets --locked
|
|
||||||
- run: cargo clippy --manifest-path imgui-gfx-examples/Cargo.toml --all-targets --locked
|
|
||||||
- run: cargo clippy --manifest-path imgui-sys-bindgen/Cargo.toml --all-targets
|
|
||||||
# supported winit versions
|
# supported winit versions
|
||||||
- run: cargo clippy --manifest-path imgui-winit-support/Cargo.toml --all-features --all-targets
|
- run: cargo clippy --manifest-path imgui-winit-support/Cargo.toml --all-features --all-targets
|
||||||
- run: cargo clippy --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-19 --all-targets
|
- run: cargo clippy --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-19 --all-targets
|
||||||
@ -78,12 +68,7 @@ jobs:
|
|||||||
- uses: hecrj/setup-rust-action@v1
|
- uses: hecrj/setup-rust-action@v1
|
||||||
with:
|
with:
|
||||||
components: rustfmt
|
components: rustfmt
|
||||||
# workspace
|
|
||||||
- run: cargo fmt --all -- --check
|
- run: cargo fmt --all -- --check
|
||||||
# excluded crates
|
|
||||||
- run: cargo fmt --manifest-path imgui-examples/Cargo.toml -- --check
|
|
||||||
- run: cargo fmt --manifest-path imgui-gfx-examples/Cargo.toml -- --check
|
|
||||||
- run: cargo fmt --manifest-path imgui-sys-bindgen/Cargo.toml -- --check
|
|
||||||
|
|
||||||
test:
|
test:
|
||||||
name: Run tests
|
name: Run tests
|
||||||
@ -130,32 +115,23 @@ jobs:
|
|||||||
path: |
|
path: |
|
||||||
~/.cargo/registry
|
~/.cargo/registry
|
||||||
~/.cargo/git
|
~/.cargo/git
|
||||||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}-${{ hashFiles('**/Cargo.lock') }}
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}-
|
${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
|
||||||
${{ runner.os }}-cargo-
|
${{ runner.os }}-cargo-
|
||||||
- name: Cache cargo target dirs
|
- name: Cache cargo target dirs
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: |
|
path: target
|
||||||
target
|
|
||||||
imgui-examples/target
|
|
||||||
imgui-gfx-examples/target
|
|
||||||
imgui-sys-bindgen/target
|
|
||||||
# note `cargo test` and `cargo clippy` don't use the same build
|
# note `cargo test` and `cargo clippy` don't use the same build
|
||||||
# artifacts, so this has a different key
|
# artifacts, so this has a different key
|
||||||
key: ${{ runner.os }}-target-test-${{ matrix.rust }}-${{ hashFiles('**/Cargo.toml') }}-${{ hashFiles('**/Cargo.lock') }}
|
key: ${{ runner.os }}-target-test-${{ matrix.rust }}-${{ hashFiles('**/Cargo.toml') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-target-test-${{ matrix.rust }}-${{ hashFiles('**/Cargo.toml') }}-
|
${{ runner.os }}-target-test-${{ matrix.rust }}-${{ hashFiles('**/Cargo.toml') }}
|
||||||
${{ runner.os }}-target-test-${{ matrix.rust }}-
|
${{ runner.os }}-target-test-${{ matrix.rust }}-
|
||||||
${{ runner.os }}-target-test-
|
- run: cargo test --workspace
|
||||||
${{ runner.os }}-target-
|
# - run: cargo test --manifest-path imgui-gfx-examples/Cargo.toml --no-default-features --features directx
|
||||||
- run: cargo test --all
|
# if: runner.os == 'Windows'
|
||||||
- run: cargo test --manifest-path imgui-examples/Cargo.toml
|
|
||||||
- run: cargo test --manifest-path imgui-gfx-examples/Cargo.toml
|
|
||||||
- run: cargo test --manifest-path imgui-sys-bindgen/Cargo.toml
|
|
||||||
- run: cargo test --manifest-path imgui-gfx-examples/Cargo.toml --no-default-features --features directx
|
|
||||||
if: runner.os == 'Windows'
|
|
||||||
- run: cargo test --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-19
|
- run: cargo test --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-19
|
||||||
- run: cargo test --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-20
|
- run: cargo test --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-20
|
||||||
- run: cargo test --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-22
|
- run: cargo test --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-22
|
||||||
|
|||||||
36
Cargo.toml
36
Cargo.toml
@ -1,41 +1,11 @@
|
|||||||
[package]
|
|
||||||
name = "imgui"
|
|
||||||
version = "0.6.0"
|
|
||||||
edition = "2018"
|
|
||||||
authors = ["The imgui-rs Developers"]
|
|
||||||
description = "High-level Rust bindings to dear imgui"
|
|
||||||
homepage = "https://github.com/imgui-rs/imgui-rs"
|
|
||||||
repository = "https://github.com/imgui-rs/imgui-rs"
|
|
||||||
license = "MIT/Apache-2.0"
|
|
||||||
categories = ["gui", "api-bindings"]
|
|
||||||
readme = "README.markdown"
|
|
||||||
|
|
||||||
exclude = [
|
|
||||||
"/resources"
|
|
||||||
]
|
|
||||||
|
|
||||||
[dependencies]
|
|
||||||
bitflags = "1.0"
|
|
||||||
glium = { version = "0.28", default-features = false, optional = true }
|
|
||||||
gfx = { version = "0.18", optional = true }
|
|
||||||
imgui-sys = { version = "0.6.0", path = "imgui-sys" }
|
|
||||||
parking_lot = "0.11"
|
|
||||||
|
|
||||||
[features]
|
|
||||||
wasm = ["imgui-sys/wasm"]
|
|
||||||
|
|
||||||
[dev-dependencies]
|
|
||||||
memoffset = "0.6"
|
|
||||||
|
|
||||||
[workspace]
|
[workspace]
|
||||||
members = [
|
members = [
|
||||||
|
"imgui",
|
||||||
"imgui-sys",
|
"imgui-sys",
|
||||||
"imgui-gfx-renderer",
|
"imgui-gfx-renderer",
|
||||||
"imgui-glium-renderer",
|
"imgui-glium-renderer",
|
||||||
"imgui-winit-support"
|
"imgui-winit-support",
|
||||||
]
|
|
||||||
exclude = [
|
|
||||||
"imgui-examples",
|
"imgui-examples",
|
||||||
"imgui-gfx-examples",
|
"imgui-gfx-examples",
|
||||||
"imgui-sys-bindgen"
|
"imgui-sys-bindgen",
|
||||||
]
|
]
|
||||||
|
|||||||
1587
imgui-examples/Cargo.lock
generated
1587
imgui-examples/Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "imgui-examples"
|
name = "examples"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
authors = ["The imgui-rs Developers"]
|
authors = ["The imgui-rs Developers"]
|
||||||
@ -13,6 +13,6 @@ publish = false
|
|||||||
clipboard = "0.5"
|
clipboard = "0.5"
|
||||||
glium = { version = "0.28", default-features = true }
|
glium = { version = "0.28", default-features = true }
|
||||||
image = "0.23"
|
image = "0.23"
|
||||||
imgui = { path = "../" }
|
imgui = { path = "../imgui" }
|
||||||
imgui-glium-renderer = { path = "../imgui-glium-renderer" }
|
imgui-glium-renderer = { path = "../imgui-glium-renderer" }
|
||||||
imgui-winit-support = { path = "../imgui-winit-support" }
|
imgui-winit-support = { path = "../imgui-winit-support" }
|
||||||
|
|||||||
1258
imgui-gfx-examples/Cargo.lock
generated
1258
imgui-gfx-examples/Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -11,18 +11,19 @@ publish = false
|
|||||||
|
|
||||||
[features]
|
[features]
|
||||||
opengl = ["imgui-gfx-renderer/opengl"]
|
opengl = ["imgui-gfx-renderer/opengl"]
|
||||||
directx = ["imgui-gfx-renderer/directx"]
|
# FIXME
|
||||||
|
# directx = ["imgui-gfx-renderer/directx"]
|
||||||
default = ["opengl"]
|
default = ["opengl"]
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
gfx = "0.18"
|
gfx = "0.18"
|
||||||
gfx_device_gl = "0.16"
|
gfx_device_gl = "0.16"
|
||||||
gfx_window_glutin = "0.31"
|
glutin = "0.25"
|
||||||
glutin = "0.21"
|
|
||||||
image = "0.23"
|
image = "0.23"
|
||||||
imgui = { path = "../" }
|
imgui = { path = "../imgui" }
|
||||||
imgui-gfx-renderer = { path = "../imgui-gfx-renderer" }
|
imgui-gfx-renderer = { path = "../imgui-gfx-renderer" }
|
||||||
imgui-winit-support = { path = "../imgui-winit-support", default-features = false, features = ["winit-19"] }
|
imgui-winit-support = { path = "../imgui-winit-support" }
|
||||||
|
old_school_gfx_glutin_ext = "0.25"
|
||||||
|
|
||||||
[target.'cfg(windows)'.dev-dependencies]
|
[target.'cfg(windows)'.dev-dependencies]
|
||||||
gfx_device_dx11 = "0.8"
|
gfx_device_dx11 = "0.8"
|
||||||
|
|||||||
@ -92,7 +92,7 @@ impl Lenna {
|
|||||||
|
|
||||||
let image = image::load_from_memory_with_format(lenna_bytes, ImageFormat::Jpeg)?;
|
let image = image::load_from_memory_with_format(lenna_bytes, ImageFormat::Jpeg)?;
|
||||||
// gfx doesn't support easily RGB8 without alpha, so we need to convert
|
// gfx doesn't support easily RGB8 without alpha, so we need to convert
|
||||||
let image = image.to_rgba();
|
let image = image.to_rgba8();
|
||||||
let (width, height) = image.dimensions();
|
let (width, height) = image.dimensions();
|
||||||
let raw_data = image.into_raw();
|
let raw_data = image.into_raw();
|
||||||
|
|
||||||
@ -5,11 +5,11 @@ mod support;
|
|||||||
fn main() {
|
fn main() {
|
||||||
let system = support::init(file!());
|
let system = support::init(file!());
|
||||||
|
|
||||||
#[cfg(feature = "opengl")]
|
let window_title = if cfg!(all(feature = "directx", windows)) {
|
||||||
let window_title = im_str!("Hello world (OpenGL)");
|
im_str!("Hello world (OpenGL)")
|
||||||
|
} else {
|
||||||
#[cfg(feature = "directx")]
|
im_str!("Hello world (DirectX)")
|
||||||
let window_title = im_str!("Hello world (DirectX)");
|
};
|
||||||
|
|
||||||
system.main_loop(|_, ui| {
|
system.main_loop(|_, ui| {
|
||||||
Window::new(window_title)
|
Window::new(window_title)
|
||||||
@ -1,14 +1,25 @@
|
|||||||
use gfx::Device;
|
use gfx::Device;
|
||||||
use glutin::{Event, WindowEvent};
|
use glutin::{
|
||||||
|
dpi::LogicalSize,
|
||||||
|
event::{Event, WindowEvent},
|
||||||
|
event_loop::{ControlFlow, EventLoop},
|
||||||
|
// XXX for easier porting...
|
||||||
|
platform::desktop::EventLoopExtDesktop,
|
||||||
|
window::WindowBuilder,
|
||||||
|
};
|
||||||
use imgui::{Context, FontConfig, FontGlyphRanges, FontSource, Ui};
|
use imgui::{Context, FontConfig, FontGlyphRanges, FontSource, Ui};
|
||||||
use imgui_gfx_renderer::{Renderer, Shaders};
|
use imgui_gfx_renderer::{Renderer, Shaders};
|
||||||
use imgui_winit_support::{HiDpiMode, WinitPlatform};
|
use imgui_winit_support::{HiDpiMode, WinitPlatform};
|
||||||
|
use old_school_gfx_glutin_ext::*;
|
||||||
use std::time::Instant;
|
use std::time::Instant;
|
||||||
|
|
||||||
type ColorFormat = gfx::format::Rgba8;
|
type ColorFormat = gfx::format::Rgba8;
|
||||||
|
type DepthFormat = gfx::format::DepthStencil;
|
||||||
|
// hack
|
||||||
|
type EventsLoop = EventLoop<()>;
|
||||||
|
|
||||||
pub struct System {
|
pub struct System {
|
||||||
pub events_loop: glutin::EventsLoop,
|
pub events_loop: EventsLoop,
|
||||||
pub imgui: Context,
|
pub imgui: Context,
|
||||||
pub platform: WinitPlatform,
|
pub platform: WinitPlatform,
|
||||||
pub render_sys: RenderSystem,
|
pub render_sys: RenderSystem,
|
||||||
@ -20,10 +31,10 @@ pub fn init(title: &str) -> System {
|
|||||||
Some(idx) => title.split_at(idx + 1).1,
|
Some(idx) => title.split_at(idx + 1).1,
|
||||||
None => title,
|
None => title,
|
||||||
};
|
};
|
||||||
let events_loop = glutin::EventsLoop::new();
|
let events_loop = EventsLoop::new();
|
||||||
let builder = glutin::WindowBuilder::new()
|
let builder = WindowBuilder::new()
|
||||||
.with_title(title.to_owned())
|
.with_title(title.to_owned())
|
||||||
.with_dimensions(glutin::dpi::LogicalSize::new(1024f64, 768f64));
|
.with_inner_size(LogicalSize::new(1024f64, 768f64));
|
||||||
|
|
||||||
let mut imgui = Context::create();
|
let mut imgui = Context::create();
|
||||||
imgui.set_ini_filename(None);
|
imgui.set_ini_filename(None);
|
||||||
@ -78,17 +89,22 @@ impl System {
|
|||||||
let mut run = true;
|
let mut run = true;
|
||||||
|
|
||||||
while run {
|
while run {
|
||||||
events_loop.poll_events(|event| {
|
events_loop.run_return(|event, _, control_flow| {
|
||||||
platform.handle_event(imgui.io_mut(), render_sys.window(), &event);
|
platform.handle_event(imgui.io_mut(), render_sys.window(), &event);
|
||||||
|
|
||||||
if let Event::WindowEvent { event, .. } = event {
|
if let Event::WindowEvent { event, .. } = event {
|
||||||
match event {
|
match event {
|
||||||
WindowEvent::Resized(size) => render_sys.update_views(size),
|
WindowEvent::Resized(_) => render_sys.update_views(),
|
||||||
WindowEvent::CloseRequested => run = false,
|
WindowEvent::CloseRequested => {
|
||||||
|
run = false;
|
||||||
|
}
|
||||||
_ => (),
|
_ => (),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*control_flow = ControlFlow::Exit;
|
||||||
});
|
});
|
||||||
|
if !run {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
let io = imgui.io_mut();
|
let io = imgui.io_mut();
|
||||||
platform
|
platform
|
||||||
@ -132,15 +148,15 @@ pub struct RenderSystem {
|
|||||||
pub device: types::Device,
|
pub device: types::Device,
|
||||||
pub factory: types::Factory,
|
pub factory: types::Factory,
|
||||||
pub main_color: Option<gfx::handle::RenderTargetView<types::Resources, ColorFormat>>,
|
pub main_color: Option<gfx::handle::RenderTargetView<types::Resources, ColorFormat>>,
|
||||||
pub main_depth: gfx::handle::DepthStencilView<types::Resources, gfx::format::DepthStencil>,
|
pub main_depth: gfx::handle::DepthStencilView<types::Resources, DepthFormat>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "opengl")]
|
#[cfg(feature = "opengl")]
|
||||||
impl RenderSystem {
|
impl RenderSystem {
|
||||||
pub fn init(
|
pub fn init(
|
||||||
imgui: &mut Context,
|
imgui: &mut Context,
|
||||||
builder: glutin::WindowBuilder,
|
builder: WindowBuilder,
|
||||||
events_loop: &glutin::EventsLoop,
|
events_loop: &EventsLoop,
|
||||||
) -> RenderSystem {
|
) -> RenderSystem {
|
||||||
{
|
{
|
||||||
// Fix incorrect colors with sRGB framebuffer
|
// Fix incorrect colors with sRGB framebuffer
|
||||||
@ -158,10 +174,14 @@ impl RenderSystem {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let context = glutin::ContextBuilder::new().with_vsync(true);
|
|
||||||
let (windowed_context, device, mut factory, main_color, main_depth) =
|
let (windowed_context, device, mut factory, main_color, main_depth) =
|
||||||
gfx_window_glutin::init(builder, context, &events_loop)
|
glutin::ContextBuilder::new()
|
||||||
.expect("Failed to initialize graphics");
|
.with_vsync(true)
|
||||||
|
.with_gfx_color_depth::<ColorFormat, DepthFormat>()
|
||||||
|
.build_windowed(builder, events_loop)
|
||||||
|
.expect("Failed to initialize graphics")
|
||||||
|
.init_gfx::<ColorFormat, DepthFormat>();
|
||||||
|
|
||||||
let shaders = {
|
let shaders = {
|
||||||
let version = device.get_info().shading_language;
|
let version = device.get_info().shading_language;
|
||||||
if version.is_embedded {
|
if version.is_embedded {
|
||||||
@ -193,16 +213,13 @@ impl RenderSystem {
|
|||||||
main_depth,
|
main_depth,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pub fn window(&self) -> &glutin::Window {
|
pub fn window(&self) -> &glutin::window::Window {
|
||||||
self.windowed_context.window()
|
self.windowed_context.window()
|
||||||
}
|
}
|
||||||
pub fn update_views(&mut self, _: glutin::dpi::LogicalSize) {
|
pub fn update_views(&mut self) {
|
||||||
if let Some(main_color) = self.main_color.as_mut() {
|
if let Some(main_color) = self.main_color.as_mut() {
|
||||||
gfx_window_glutin::update_views(
|
self.windowed_context
|
||||||
&self.windowed_context,
|
.update_gfx(main_color, &mut self.main_depth);
|
||||||
main_color,
|
|
||||||
&mut self.main_depth,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pub fn swap_buffers(&mut self) {
|
pub fn swap_buffers(&mut self) {
|
||||||
@ -210,14 +227,14 @@ impl RenderSystem {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "directx")]
|
#[cfg(all(feature = "directx", windows))]
|
||||||
mod types {
|
mod types {
|
||||||
pub type Device = gfx_device_dx11::Device;
|
pub type Device = gfx_device_dx11::Device;
|
||||||
pub type Factory = gfx_device_dx11::Factory;
|
pub type Factory = gfx_device_dx11::Factory;
|
||||||
pub type Resources = gfx_device_dx11::Resources;
|
pub type Resources = gfx_device_dx11::Resources;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "directx")]
|
#[cfg(all(feature = "directx", windows))]
|
||||||
pub struct RenderSystem {
|
pub struct RenderSystem {
|
||||||
pub renderer: Renderer<ColorFormat, types::Resources>,
|
pub renderer: Renderer<ColorFormat, types::Resources>,
|
||||||
pub window: gfx_window_dxgi::Window,
|
pub window: gfx_window_dxgi::Window,
|
||||||
@ -226,12 +243,12 @@ pub struct RenderSystem {
|
|||||||
pub main_color: Option<gfx::handle::RenderTargetView<types::Resources, ColorFormat>>,
|
pub main_color: Option<gfx::handle::RenderTargetView<types::Resources, ColorFormat>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "directx")]
|
#[cfg(all(feature = "directx", windows))]
|
||||||
impl RenderSystem {
|
impl RenderSystem {
|
||||||
pub fn init(
|
pub fn init(
|
||||||
imgui: &mut Context,
|
imgui: &mut Context,
|
||||||
builder: glutin::WindowBuilder,
|
builder: WindowBuilder,
|
||||||
events_loop: &glutin::EventsLoop,
|
events_loop: &EventsLoop,
|
||||||
) -> RenderSystem {
|
) -> RenderSystem {
|
||||||
let (window, device, mut factory, main_color) =
|
let (window, device, mut factory, main_color) =
|
||||||
gfx_window_dxgi::init(builder, &events_loop).expect("Failed to initialize graphics");
|
gfx_window_dxgi::init(builder, &events_loop).expect("Failed to initialize graphics");
|
||||||
@ -248,7 +265,7 @@ impl RenderSystem {
|
|||||||
pub fn window(&self) -> &glutin::Window {
|
pub fn window(&self) -> &glutin::Window {
|
||||||
&self.window.inner
|
&self.window.inner
|
||||||
}
|
}
|
||||||
pub fn update_views(&mut self, size: glutin::dpi::LogicalSize) {
|
pub fn update_views(&mut self, size: LogicalSize) {
|
||||||
let physical = size.to_physical(self.window().get_hidpi_factor());
|
let physical = size.to_physical(self.window().get_hidpi_factor());
|
||||||
let (width, height): (u32, u32) = physical.into();
|
let (width, height): (u32, u32) = physical.into();
|
||||||
let _ = self.main_color.take(); // we need to drop main_color before calling update_views
|
let _ = self.main_color.take(); // we need to drop main_color before calling update_views
|
||||||
|
|||||||
@ -16,7 +16,7 @@ default = ["opengl"]
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
gfx = "0.18"
|
gfx = "0.18"
|
||||||
imgui = { version = "0.6.0", path = "../", features = ["gfx"] }
|
imgui = { version = "0.6.0", path = "../imgui", features = ["gfx"] }
|
||||||
|
|
||||||
[target.'cfg(windows)'.build-dependencies]
|
[target.'cfg(windows)'.build-dependencies]
|
||||||
winapi = { version = "0.3", features = ["d3dcompiler"] }
|
winapi = { version = "0.3", features = ["d3dcompiler"] }
|
||||||
|
|||||||
@ -11,4 +11,4 @@ categories = ["gui", "rendering"]
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
glium = { version = "0.28", default-features = false }
|
glium = { version = "0.28", default-features = false }
|
||||||
imgui = { version = "0.6.0", path = "../", features = ["glium"] }
|
imgui = { version = "0.6.0", path = "../imgui", features = ["glium"] }
|
||||||
|
|||||||
@ -10,7 +10,7 @@ license = "MIT/Apache-2.0"
|
|||||||
publish = false
|
publish = false
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
bindgen = "0.55"
|
bindgen = { version = "0.56", default-features = false }
|
||||||
serde = "1.0"
|
serde = "1.0"
|
||||||
serde_derive = "1.0"
|
serde_derive = "1.0"
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
|
|||||||
@ -10,9 +10,9 @@ license = "MIT/Apache-2.0"
|
|||||||
categories = ["gui"]
|
categories = ["gui"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
imgui = { version = "0.6.0", path = "../" }
|
imgui = { version = "0.6.0", path = "../imgui" }
|
||||||
winit-19 = { version = ">= 0.16, <= 0.19", package = "winit", optional = true }
|
winit-19 = { version = ">= 0.16, < 0.20", package = "winit", optional = true }
|
||||||
winit-20 = { version = ">= 0.20, <= 0.21", package = "winit", optional = true }
|
winit-20 = { version = ">= 0.20, < 0.22", package = "winit", optional = true }
|
||||||
winit-22 = { version = "0.22", package = "winit", optional = true }
|
winit-22 = { version = "0.22", package = "winit", optional = true }
|
||||||
winit-23 = { version = "0.23", package = "winit", optional = true }
|
winit-23 = { version = "0.23", package = "winit", optional = true }
|
||||||
|
|
||||||
|
|||||||
26
imgui/Cargo.toml
Normal file
26
imgui/Cargo.toml
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
[package]
|
||||||
|
name = "imgui"
|
||||||
|
version = "0.6.0"
|
||||||
|
edition = "2018"
|
||||||
|
authors = ["The imgui-rs Developers"]
|
||||||
|
description = "High-level Rust bindings to dear imgui"
|
||||||
|
homepage = "https://github.com/imgui-rs/imgui-rs"
|
||||||
|
repository = "https://github.com/imgui-rs/imgui-rs"
|
||||||
|
license = "MIT/Apache-2.0"
|
||||||
|
categories = ["gui", "api-bindings"]
|
||||||
|
readme = "README.markdown"
|
||||||
|
|
||||||
|
exclude = ["/resources"]
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
bitflags = "1.0"
|
||||||
|
glium = { version = "0.28", default-features = false, optional = true }
|
||||||
|
gfx = { version = "0.18", optional = true }
|
||||||
|
imgui-sys = { version = "0.6.0", path = "../imgui-sys" }
|
||||||
|
parking_lot = "0.11"
|
||||||
|
|
||||||
|
[features]
|
||||||
|
wasm = ["imgui-sys/wasm"]
|
||||||
|
|
||||||
|
[dev-dependencies]
|
||||||
|
memoffset = "0.6"
|
||||||
Loading…
x
Reference in New Issue
Block a user