* WIP: Render API v2
* Fix doctests
* Expose all of PixelsContext (#110)
* Fix ScalingRenderer::new() taking &mut Device
* Replace getters with direct access to &mut PixelsContext
* Fix wrong reference type
* Fix unneeded mut
* Remove unnecessary mutable borrow, resurrect the shorter getter methods
* Initial port to wgpu master (0.6)
Surface creation is broken (see examples)
Does not support compressed textures
* Fix SurfaceTexture and examples
* Add support for compressed texture formats
* resize doesn't need mutability
* Update documentation
* Update wgpu
* Prepare release
* Goodbye Travis! Thanks for all the fish
Co-authored-by: JMS55 <47158642+JMS55@users.noreply.github.com>
* Add a method to convert cursor coords to pixel coords
* Add method `window_pos_to_pixel` to Pixels struct
* Converts cursor / window physical coordinates to pixel coords
* Fix formatting
* Return result rather than clamping pixel coordinates
* Use transformation matrices to convert from cursor coord to pixel
* Adds a struct ScalingMatrix that manages the creation and usage
of the transformation matrix used in the renderer.
* Added an inverse function on ScalingMatrix - 4x4 matrix inverse
(This should probably use a library, but it doesn't seem worth
adding a dependancy for one function)
* Optimize matrix multiplication for cursor position calculation
* Use ultraviolet for matrix and vector math
* Add suggested changes
This keeps the split between usize and isize
This also changes the input cursor position to f32, because it was
immediately cast to an f32 for the transformations.
* Add builder methods for VSync and setting wgpu backends
* enable_vsync sets the VSync mode
* wgpu_backend sets the wgpu BackendBit struct
* Made RequestAdapterOptions use compatible_surface by default
* Internally store wgpu::PresentMode for enabling vsync
This doesn't expose the PresentMode for the external api, because
the variants of PresentMode aren't very obvious to people without
wgpu experience. Mailbox corresponds to VSync enabled, and
Immediate corresponds to VSync disabled.
* Move all examples to individual crates
* CI: Add libsdl2
* Use Ubuntu bionic for updated libsdl; 2.0.8
* Clippy
* libudev-dev is a dependency of libsdl2-dev
* Clippy
* Remove unnecessary dev-dependency
* `winit` is actually used in unit tests
* Fix a typo
* Move `simple-invaders` crate
* remove unsafe slice::from_raw_parts
this should be a way to remove the unsafe code in the Spirv Deref impl.
Not sure how it affects performance yet.
I will take a look at the bytecode and see if maybe the compiler is
smart enough to optimize that away.
* change renderers to accomodate new Deref
Let the deref return a `Vec<u32>` instead of a slice reference. This
should not hurt performance too much as this will be done a finite
amount of times att startup.
* replaced deref with normal impl
* fixed endianness, fixed offset + rustfmt
* bump version
* fixed clippy lints
* respect the target endianness
* use wgpu::read_spirv()
* remove an unneccessary allocation of a vec
* move borrow into macro
* Refactor window creation and size handling
* Require pixel aspect ratio to be > 0
* Fix screen scaling when window is resized
- Ensure the screen retains its correct pixel aspect ratio
- Updated public API on `RenderPass` ... this will continue to be unstable until the initial release
- Add build instructions for the internal shaders
* Enable clippy in CI
- Removed beta and nightly channels to prevent build breakage
- Fixed some lints noted by `pedantic` and `nursery` level (but not denying these levels by default)
- Accepts a closure (factory function) which itself accepts references to the `wgpu` instances needed for rendering
- This solves a need for creating `RenderPass` objects with a lot of `Option` types and trying to update them dynamically after the fact
- In other words, this is an RAII implementation
- `RenderPass` objects are created during the `PixelsBuilder` build stage
- It should prevent patterns where half-created `RenderPass` objects are necessary
- The example app generates a scaled version of pixel Ferris as a test.
- TODO:
- Pixel aspect ratio is still unsupported
- The `RenderPass` trait is incomplete