mirror of
https://github.com/eliasstepanik/imgui-rs.git
synced 2026-01-24 20:08:31 +00:00
Update dependencies in glium examples
This commit is contained in:
parent
a51afa0539
commit
7049dfdc68
547
imgui-glium-examples/Cargo.lock
generated
547
imgui-glium-examples/Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -14,4 +14,4 @@ glium = { version = "0.23", default-features = true }
|
|||||||
imgui = { version = "0.0.23-pre", path = "../" }
|
imgui = { version = "0.0.23-pre", path = "../" }
|
||||||
imgui-glium-renderer = { version = "0.0.23-pre", path = "../imgui-glium-renderer" }
|
imgui-glium-renderer = { version = "0.0.23-pre", path = "../imgui-glium-renderer" }
|
||||||
imgui-winit-support = { version = "0.0.23-pre", path = "../imgui-winit-support" }
|
imgui-winit-support = { version = "0.0.23-pre", path = "../imgui-winit-support" }
|
||||||
image = "0.20"
|
image = "0.21"
|
||||||
|
|||||||
@ -7,7 +7,7 @@ use glium::{
|
|||||||
texture::{ClientFormat, RawImage2d},
|
texture::{ClientFormat, RawImage2d},
|
||||||
Texture2d,
|
Texture2d,
|
||||||
};
|
};
|
||||||
use image::{jpeg::JPEGDecoder, DecodingResult, ImageDecoder};
|
use image::{jpeg::JPEGDecoder, ImageDecoder};
|
||||||
use imgui::*;
|
use imgui::*;
|
||||||
|
|
||||||
mod support;
|
mod support;
|
||||||
@ -51,7 +51,7 @@ impl CustomTexturesApp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let raw = RawImage2d {
|
let raw = RawImage2d {
|
||||||
data: Cow::Borrowed(&data),
|
data: Cow::Owned(data),
|
||||||
width: WIDTH as u32,
|
width: WIDTH as u32,
|
||||||
height: HEIGHT as u32,
|
height: HEIGHT as u32,
|
||||||
format: ClientFormat::U8U8U8,
|
format: ClientFormat::U8U8U8,
|
||||||
@ -94,19 +94,15 @@ impl Lenna {
|
|||||||
{
|
{
|
||||||
let lenna_bytes = include_bytes!("../../resources/Lenna.jpg");
|
let lenna_bytes = include_bytes!("../../resources/Lenna.jpg");
|
||||||
let byte_stream = Cursor::new(lenna_bytes.as_ref());
|
let byte_stream = Cursor::new(lenna_bytes.as_ref());
|
||||||
let mut decoder = JPEGDecoder::new(byte_stream);
|
let decoder = JPEGDecoder::new(byte_stream)?;
|
||||||
|
|
||||||
let (width, height) = decoder.dimensions()?;
|
let (width, height) = decoder.dimensions();
|
||||||
let image = decoder.read_image()?;
|
let image = decoder.read_image()?;
|
||||||
let raw = if let DecodingResult::U8(data) = &image {
|
let raw = RawImage2d {
|
||||||
RawImage2d {
|
data: Cow::Owned(image),
|
||||||
data: Cow::Borrowed(data),
|
width: width as u32,
|
||||||
width,
|
height: height as u32,
|
||||||
height,
|
format: ClientFormat::U8U8U8,
|
||||||
format: ClientFormat::U8U8U8,
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
unimplemented!("I only know how to deal with U8 data")
|
|
||||||
};
|
};
|
||||||
let gl_texture = Texture2d::new(gl_ctx, raw)?;
|
let gl_texture = Texture2d::new(gl_ctx, raw)?;
|
||||||
let texture_id = textures.insert(gl_texture);
|
let texture_id = textures.insert(gl_texture);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user