Commit graph

179 commits

Author SHA1 Message Date
i509VCB
d0fed096b6
wayland: temporary horrible fix for damage 2022-06-02 18:20:13 -05:00
Kevin Reid
1c0683c88d Make GraphicsContext::window_mut() an unsafe fn.
As documented in the new safety comment, providing `&mut` access to an
inner component about which there are consistency invariants is unsafe,
because `&mut` is sufficient for a caller to completely replace the
value (using assignment or `std::mem::swap()`).

Luckily, when `softbuffer` is used with `winit`, no `&mut` access is
needed. However, other windowing libraries such as `glfw` and `sdl2` do
have `&mut` methods, so this method can't simply be removed.

This is a breaking change since it makes a previously safe function
unsafe, and should not be published without a major version bump
(i.e. to `0.2.0` or higher).
2022-05-26 08:37:37 -07:00
Kevin Reid
cfbde6073c Add impl AsRef<W> for GraphicsContext<W>.
This will allow code which works with windows generically (such as an
event loop which can work with `softbuffer` or another graphics library)
to be able to access the underlying window without knowing about
`softbuffer` in particular.
2022-05-26 08:37:11 -07:00
David Johnson
08883d76c5 Bumped version to 0.1.1, updated README.md, added changelog to README.md 2022-05-22 18:20:40 -05:00
David Johnson
dac367138e
Merge pull request #3 from lunixbochs/calayer
use CALayer for macOS backend
2022-05-17 00:14:15 -05:00
Ryan Hileman
112e777179 macOS: use a subview, improve image handling 2022-05-16 10:16:50 -07:00
Ryan Hileman
44d1ababf0 CALayer: place buffer in top left instead of scaling to window 2022-05-16 09:15:21 -07:00
Ryan Hileman
ba3b823e1c use CALayer for macOS backend 2022-04-24 07:31:19 -07:00
David Johnson
75216061b7
Merge pull request #2 from Liamolucko/web
Add web support
2022-02-27 22:36:09 -06:00
Liam Murphy
62529c4069 Show web as supported in README 2022-02-23 20:08:16 +11:00
Liam Murphy
7b4717fdc4 Don't use rayon in examples on wasm 2022-02-23 19:13:26 +11:00
Liam Murphy
d735510f72 Add web support
A limitation of this implementation is that it can't coexist with anything which creates a canvas context other than `CanvasRenderingContext2D`, since only one context can exist per canvas.
2022-02-12 20:24:18 +11:00
David Johnson
bc900e69e7 Added animation demo 2022-01-31 22:03:48 -06:00
David Johnson
4311b27193 Modified Cargo.toml and README.md to prepare for publication to crates.io 2022-01-19 21:57:09 -06:00
David Johnson
d8087a68a0 Added Wayland support 2022-01-19 21:26:20 -06:00
David Johnson
d4dea5a95f Updated README.md to reflect AppKit support 2022-01-19 00:16:31 -06:00
john01dav
55f5c79dc9
Merge pull request #1 from sanxiyn/core-graphics
Add macOS support using Core Graphics
2022-01-18 23:44:49 -06:00
Seo Sanghyeon
f5b18e8196 Adapt to Core Graphics coordinate system 2022-01-19 14:04:17 +09:00
Seo Sanghyeon
7ff0d65793 Add macOS support using Core Graphics 2022-01-19 13:18:09 +09:00
David Johnson
a23b7f9876 Added fruit example to show a more recognizable image for debugging 2022-01-18 22:07:17 -06:00
David Johnson
b5573de387 Added decription to Cargo.toml 2022-01-16 09:02:22 -06:00
David Johnson
dc6fc474be Added better error handling 2022-01-16 09:01:02 -06:00
David Johnson
e4b1917333 Correctly ser version, authors, and license in Cargo.toml 2022-01-16 08:45:01 -06:00
David Johnson
e7b6541de9 Added README.md 2022-01-16 08:43:00 -06:00
David Johnson
5cdaae1412 Added rustdoc to all public items 2022-01-16 08:17:53 -06:00
David Johnson
8286c2bd6c Added safety checks for incorrectly sized buffers being passed 2022-01-16 08:07:39 -06:00
David Johnson
d89a0c92aa Added windows support and made example render something fancier 2022-01-16 08:03:20 -06:00
David Johnson
a36b11a934 X11 implementation no longer has an extraneous copy to deal with xlib's lifetime requirements 2022-01-15 08:33:24 -06:00
David Johnson
384f2dc9a3 Added X11 support 2022-01-15 08:17:17 -06:00