* make `pixels::Color` have a stable representation (`repr(C)`)
this allows for faster code and is also needed for SDL_RenderGeometry
* add binding for SDL_RenderGeometryRaw
* add example of advanced use of `Canvas::render_geometry`
* update unsafe trait docs to include a needed guarantee
and refer to one doc comment instead of duplicating similar ones
* rework almost everything
- the macro was very hard to get sound, auto deref has to be prevented somehow
- the unsafe traits could not be implemented for types defined in other crates
the unsafety must be kept simple, users now only need to provide the
right offsets, which core::mem::offset_of does
update example
* add convenience impls for &Vec<_> to VertexIndices
* update example to use 2 ways of using render_geometry_raw, and use render_geometry
* mention alignment in safety comments in render_geometry example
* fix and improve docs
* update changelog
* remove `impl ToColor for isize`
- there is an impl for `u32` already, that impl is now the only one so
rustc easily figures out the number type, that does not have to be
explicitly annotated anymore.
- `isize` is not always wide enough to represent all colors. writing
0xff0000ffisize compiles on 64 bit systems but not on 32 or 16 bit
systems. (deny-by-default warning, if `allow`ed it will panic at
runtime)
* update changelog
* fix transmuting to invalid value
* fix public access to raw pointer
* add `repr(transparent)` to safely pointer-cast
between `FRect` and `sys::SDL_FRect`, and `FPoint` and`sys::SDL_FPoint`.
* add null pointer check before calling `CStr::from_ptr`
also shrink unsafe blocks
* return pointer with mutable provenance from `FRect::raw_mut`
before this commit writing to the pointer returned by `FRect::raw_mut`
was undefined behavior.
* fix use after free and unwind through FFI boundary in timer.rs
* update changelog
On windows the ANDROID_NDK_HOME path can use backslashes. This causes
issues in cmake. Replaces \ with / on windows compilation hosts.
Co-authored-by: ciciplusplus <ciciplusplus@gmail.com>
* prevent users from creating `Sdl2TtfContext` out of nothing
and various other changes, including:
- allow multiple `ttf::init` calls, the same way it works with TTF_Init
- return last sdl error instead of I/O error (like stale pr #1348, fixes#1347 and closes#1348)
- implement `Clone` for `Sdl2TtfContext`, SDL C code will do the reference counting
- make `ttf::font::internal_*` `pub(super)`
- make `ttf::font::Font::raw` safe (obtaining a raw pointer is safe, using it is unsafe)
* remove `InitError` because only one variant was used
* update changelog