Rename GraphicsInformation to Information
This commit is contained in:
parent
7a13928130
commit
5be1ac18fe
7 changed files with 13 additions and 13 deletions
|
|
@ -67,10 +67,10 @@ impl iced_graphics::window::GLCompositor for Compositor {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_information(&self) -> iced_graphics::window::GraphicsInformation {
|
fn get_information(&self) -> iced_graphics::window::Information {
|
||||||
let adapter = unsafe { self.gl.get_parameter_string(glow::RENDERER) };
|
let adapter = unsafe { self.gl.get_parameter_string(glow::RENDERER) };
|
||||||
|
|
||||||
iced_graphics::window::GraphicsInformation {
|
iced_graphics::window::Information {
|
||||||
backend: format!("{:?}", self.gl.version()),
|
backend: format!("{:?}", self.gl.version()),
|
||||||
adapter,
|
adapter,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ mod compositor;
|
||||||
#[cfg(feature = "opengl")]
|
#[cfg(feature = "opengl")]
|
||||||
mod gl_compositor;
|
mod gl_compositor;
|
||||||
|
|
||||||
pub use compositor::{Compositor, GraphicsInformation, SurfaceError};
|
pub use compositor::{Compositor, Information, SurfaceError};
|
||||||
|
|
||||||
#[cfg(feature = "opengl")]
|
#[cfg(feature = "opengl")]
|
||||||
pub use gl_compositor::GLCompositor;
|
pub use gl_compositor::GLCompositor;
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ pub trait Compositor: Sized {
|
||||||
);
|
);
|
||||||
|
|
||||||
/// Returns [`GraphicsInformation`] used by this [`Compositor`].
|
/// Returns [`GraphicsInformation`] used by this [`Compositor`].
|
||||||
fn get_information(&self) -> GraphicsInformation;
|
fn get_information(&self) -> Information;
|
||||||
|
|
||||||
/// Presents the [`Renderer`] primitives to the next frame of the given [`Surface`].
|
/// Presents the [`Renderer`] primitives to the next frame of the given [`Surface`].
|
||||||
///
|
///
|
||||||
|
|
@ -77,7 +77,7 @@ pub enum SurfaceError {
|
||||||
|
|
||||||
/// Contains informations about the graphics (e.g. graphics adapter, graphics backend).
|
/// Contains informations about the graphics (e.g. graphics adapter, graphics backend).
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct GraphicsInformation {
|
pub struct Information {
|
||||||
/// Contains the graphics adapter.
|
/// Contains the graphics adapter.
|
||||||
pub adapter: String,
|
pub adapter: String,
|
||||||
/// Contains the graphics backend.
|
/// Contains the graphics backend.
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
use crate::window::GraphicsInformation;
|
use crate::window::Information;
|
||||||
use crate::{Color, Error, Size, Viewport};
|
use crate::{Color, Error, Size, Viewport};
|
||||||
|
|
||||||
use core::ffi::c_void;
|
use core::ffi::c_void;
|
||||||
|
|
@ -50,7 +50,7 @@ pub trait GLCompositor: Sized {
|
||||||
fn resize_viewport(&mut self, physical_size: Size<u32>);
|
fn resize_viewport(&mut self, physical_size: Size<u32>);
|
||||||
|
|
||||||
/// Returns [`GraphicsInformation`] used by this [`Compositor`].
|
/// Returns [`GraphicsInformation`] used by this [`Compositor`].
|
||||||
fn get_information(&self) -> GraphicsInformation;
|
fn get_information(&self) -> Information;
|
||||||
|
|
||||||
/// Presents the primitives of the [`Renderer`] to the next frame of the
|
/// Presents the primitives of the [`Renderer`] to the next frame of the
|
||||||
/// [`GLCompositor`].
|
/// [`GLCompositor`].
|
||||||
|
|
|
||||||
|
|
@ -157,10 +157,10 @@ impl iced_graphics::window::Compositor for Compositor {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_information(&self) -> iced_graphics::window::GraphicsInformation {
|
fn get_information(&self) -> iced_graphics::window::Information {
|
||||||
let information = self.adapter.get_info();
|
let information = self.adapter.get_info();
|
||||||
|
|
||||||
iced_graphics::window::GraphicsInformation {
|
iced_graphics::window::Information {
|
||||||
adapter: information.name,
|
adapter: information.name,
|
||||||
backend: format!("{:?}", information.backend),
|
backend: format!("{:?}", information.backend),
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -520,7 +520,7 @@ pub fn update<A: Application, E: Executor>(
|
||||||
debug: &mut Debug,
|
debug: &mut Debug,
|
||||||
messages: &mut Vec<A::Message>,
|
messages: &mut Vec<A::Message>,
|
||||||
window: &winit::window::Window,
|
window: &winit::window::Window,
|
||||||
graphics_info: &window::GraphicsInformation,
|
graphics_info: &window::Information,
|
||||||
) {
|
) {
|
||||||
for message in messages.drain(..) {
|
for message in messages.drain(..) {
|
||||||
debug.log_message(&message);
|
debug.log_message(&message);
|
||||||
|
|
@ -543,7 +543,7 @@ pub fn run_command<Message: 'static + std::fmt::Debug + Send, E: Executor>(
|
||||||
clipboard: &mut Clipboard,
|
clipboard: &mut Clipboard,
|
||||||
proxy: &mut winit::event_loop::EventLoopProxy<Message>,
|
proxy: &mut winit::event_loop::EventLoopProxy<Message>,
|
||||||
window: &winit::window::Window,
|
window: &winit::window::Window,
|
||||||
graphics_info: &window::GraphicsInformation,
|
graphics_info: &window::Information,
|
||||||
) {
|
) {
|
||||||
use iced_native::command;
|
use iced_native::command;
|
||||||
use iced_native::system;
|
use iced_native::system;
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ pub fn information<Message>(
|
||||||
|
|
||||||
#[cfg(feature = "sysinfo")]
|
#[cfg(feature = "sysinfo")]
|
||||||
pub(crate) fn get_information(
|
pub(crate) fn get_information(
|
||||||
graphics_info: &window::GraphicsInformation,
|
graphics_info: &window::Information,
|
||||||
) -> Option<Information> {
|
) -> Option<Information> {
|
||||||
use sysinfo::{ProcessExt, ProcessorExt, System, SystemExt};
|
use sysinfo::{ProcessExt, ProcessorExt, System, SystemExt};
|
||||||
let mut system = System::new_all();
|
let mut system = System::new_all();
|
||||||
|
|
@ -47,7 +47,7 @@ pub(crate) fn get_information(
|
||||||
|
|
||||||
#[cfg(not(feature = "sysinfo"))]
|
#[cfg(not(feature = "sysinfo"))]
|
||||||
pub(crate) fn get_information(
|
pub(crate) fn get_information(
|
||||||
_graphics_info: &window::GraphicsInformation,
|
_graphics_info: &window::Information,
|
||||||
) -> Option<Information> {
|
) -> Option<Information> {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue