diff --git a/fyrox-graphics-gl/Cargo.toml b/fyrox-graphics-gl/Cargo.toml index 3da81103c..b38df26ae 100644 --- a/fyrox-graphics-gl/Cargo.toml +++ b/fyrox-graphics-gl/Cargo.toml @@ -19,6 +19,7 @@ fyrox-core = { version = "0.36", path = "../fyrox-core" } fxhash = "0.2.1" regex = "1" glow = "0.16" +serde = { version = "1.0.215", features = ["derive"] } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] glutin = "0.31" diff --git a/fyrox-graphics-gl/src/buffer.rs b/fyrox-graphics-gl/src/buffer.rs index 9865bd6ff..c0068dea4 100644 --- a/fyrox-graphics-gl/src/buffer.rs +++ b/fyrox-graphics-gl/src/buffer.rs @@ -18,8 +18,8 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. -use crate::ToGlConstant; use crate::server::GlGraphicsServer; +use crate::ToGlConstant; use fyrox_graphics::{ buffer::{BufferKind, BufferUsage, GpuBufferTrait}, error::FrameworkError, diff --git a/fyrox-graphics-gl/src/framebuffer.rs b/fyrox-graphics-gl/src/framebuffer.rs index 219b4e25a..0a6916e3a 100644 --- a/fyrox-graphics-gl/src/framebuffer.rs +++ b/fyrox-graphics-gl/src/framebuffer.rs @@ -20,11 +20,10 @@ use crate::texture::PixelDescriptor; pub use crate::{ - ToGlConstant, buffer::GlBuffer, geometry_buffer::GlGeometryBuffer, program::GlProgram, - sampler::GlSampler, server::GlGraphicsServer, texture::GlTexture, + buffer::GlBuffer, geometry_buffer::GlGeometryBuffer, program::GlProgram, sampler::GlSampler, + server::GlGraphicsServer, texture::GlTexture, ToGlConstant, }; use fyrox_graphics::{ - ColorMask, DrawParameters, ElementRange, buffer::GpuBufferTrait, core::{color::Color, math::Rect}, error::FrameworkError, @@ -37,6 +36,7 @@ use fyrox_graphics::{ gpu_program::GpuProgram, gpu_texture::image_2d_size_bytes, gpu_texture::{CubeMapFace, GpuTextureKind, GpuTextureTrait, PixelElementKind}, + ColorMask, DrawParameters, ElementRange, }; use glow::{HasContext, PixelPackData}; use std::rc::Weak; diff --git a/fyrox-graphics-gl/src/geometry_buffer.rs b/fyrox-graphics-gl/src/geometry_buffer.rs index 4e2c498d0..c84f053cd 100644 --- a/fyrox-graphics-gl/src/geometry_buffer.rs +++ b/fyrox-graphics-gl/src/geometry_buffer.rs @@ -18,15 +18,15 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. -use crate::{ToGlConstant, buffer::GlBuffer, server::GlGraphicsServer}; +use crate::{buffer::GlBuffer, server::GlGraphicsServer, ToGlConstant}; use fyrox_graphics::{ - ElementKind, buffer::{BufferKind, GpuBufferTrait}, core::{array_as_u8_slice, math::TriangleDefinition}, error::FrameworkError, geometry_buffer::{ AttributeKind, ElementsDescriptor, GeometryBufferDescriptor, GpuGeometryBufferTrait, }, + ElementKind, }; use glow::HasContext; use std::{cell::Cell, marker::PhantomData, rc::Weak}; diff --git a/fyrox-graphics-gl/src/program.rs b/fyrox-graphics-gl/src/program.rs index 028ed3cbe..4c21d05ed 100644 --- a/fyrox-graphics-gl/src/program.rs +++ b/fyrox-graphics-gl/src/program.rs @@ -19,8 +19,8 @@ // SOFTWARE. use crate::{ - ToGlConstant, server::{GlGraphicsServer, GlKind}, + ToGlConstant, }; use fyrox_graphics::{ core::log::{Log, MessageKind}, @@ -499,7 +499,7 @@ impl Drop for GlProgram { #[cfg(test)] mod test { - use crate::program::{Vendor, patch_error_message}; + use crate::program::{patch_error_message, Vendor}; #[test] fn test_line_correction() { diff --git a/fyrox-graphics-gl/src/read_buffer.rs b/fyrox-graphics-gl/src/read_buffer.rs index ba70d41c0..122bd8f3a 100644 --- a/fyrox-graphics-gl/src/read_buffer.rs +++ b/fyrox-graphics-gl/src/read_buffer.rs @@ -19,13 +19,13 @@ // SOFTWARE. use crate::texture::PixelDescriptor; -use crate::{ToGlConstant, buffer::GlBuffer, framebuffer::GlFrameBuffer, server::GlGraphicsServer}; +use crate::{buffer::GlBuffer, framebuffer::GlFrameBuffer, server::GlGraphicsServer, ToGlConstant}; use fyrox_graphics::{ buffer::{BufferKind, BufferUsage, GpuBufferTrait}, core::{algebra::Vector2, math::Rect}, error::FrameworkError, framebuffer::GpuFrameBufferTrait, - gpu_texture::{GpuTextureKind, image_2d_size_bytes}, + gpu_texture::{image_2d_size_bytes, GpuTextureKind}, read_buffer::GpuAsyncReadBufferTrait, }; use glow::{HasContext, PixelPackData}; diff --git a/fyrox-graphics-gl/src/sampler.rs b/fyrox-graphics-gl/src/sampler.rs index c10c19409..f3bcdef47 100644 --- a/fyrox-graphics-gl/src/sampler.rs +++ b/fyrox-graphics-gl/src/sampler.rs @@ -18,7 +18,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. -use crate::{ToGlConstant, server::GlGraphicsServer}; +use crate::{server::GlGraphicsServer, ToGlConstant}; use fyrox_graphics::{ error::FrameworkError, sampler::{ diff --git a/fyrox-graphics-gl/src/server.rs b/fyrox-graphics-gl/src/server.rs index 19da7d335..3551757d2 100644 --- a/fyrox-graphics-gl/src/server.rs +++ b/fyrox-graphics-gl/src/server.rs @@ -408,7 +408,7 @@ impl GlGraphicsServer { #[cfg(target_arch = "wasm32")] let (window, mut context, gl_kind) = { - use crate::core::wasm_bindgen::JsCast; + use fyrox_core::wasm_bindgen::JsCast; use serde::{Deserialize, Serialize}; use winit::{ dpi::{LogicalSize, PhysicalSize}, @@ -418,7 +418,7 @@ impl GlGraphicsServer { let inner_size = window_builder.window_attributes().inner_size; let window = window_builder.build(window_target).unwrap(); - let web_window = crate::core::web_sys::window().unwrap(); + let web_window = fyrox_core::web_sys::window().unwrap(); let scale_factor = web_window.device_pixel_ratio(); let canvas = window.canvas().unwrap(); @@ -475,7 +475,7 @@ impl GlGraphicsServer { ) .unwrap() .unwrap() - .dyn_into::() + .dyn_into::() .unwrap(); ( window, diff --git a/fyrox-graphics-gl/src/texture.rs b/fyrox-graphics-gl/src/texture.rs index 97fd93c22..b37603c17 100644 --- a/fyrox-graphics-gl/src/texture.rs +++ b/fyrox-graphics-gl/src/texture.rs @@ -18,15 +18,15 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. -use crate::{ToGlConstant, server::GlGraphicsServer}; +use crate::{server::GlGraphicsServer, ToGlConstant}; use fyrox_graphics::{ error::FrameworkError, gpu_texture::{ - CubeMapFace, GpuTextureDescriptor, GpuTextureKind, GpuTextureTrait, PixelKind, - image_1d_size_bytes, image_2d_size_bytes, image_3d_size_bytes, + image_1d_size_bytes, image_2d_size_bytes, image_3d_size_bytes, CubeMapFace, + GpuTextureDescriptor, GpuTextureKind, GpuTextureTrait, PixelKind, }, }; -use glow::{COMPRESSED_RED_RGTC1, COMPRESSED_RG_RGTC2, HasContext, PixelUnpackData}; +use glow::{HasContext, PixelUnpackData, COMPRESSED_RED_RGTC1, COMPRESSED_RG_RGTC2}; use std::cell::Cell; use std::{ marker::PhantomData, diff --git a/fyrox-material/src/loader.rs b/fyrox-material/src/loader.rs index 281b49f3a..d4a0708e4 100644 --- a/fyrox-material/src/loader.rs +++ b/fyrox-material/src/loader.rs @@ -21,7 +21,7 @@ //! Material loader. use crate::Material; -use fyrox_core::{TypeUuidProvider, uuid::Uuid}; +use fyrox_core::{uuid::Uuid, TypeUuidProvider}; use fyrox_resource::state::LoadError; use fyrox_resource::{ io::ResourceIo, diff --git a/fyrox-material/src/shader/loader.rs b/fyrox-material/src/shader/loader.rs index a9e2e1bf3..47be497dd 100644 --- a/fyrox-material/src/shader/loader.rs +++ b/fyrox-material/src/shader/loader.rs @@ -21,7 +21,7 @@ //! Shader loader. use crate::shader::Shader; -use fyrox_core::{TypeUuidProvider, uuid::Uuid}; +use fyrox_core::{uuid::Uuid, TypeUuidProvider}; use fyrox_resource::{ io::ResourceIo, loader::{BoxedLoaderFuture, LoaderPayload, ResourceLoader},