v0.7.0
Breaking Changes
UnwindSafe
has been removed from the bounds ofWindowBehavior::Context
,
and various types may or may no longer implmementUnwindSafe
. The underlying
requirement for this has been removed fromappit
.Texture::lazy_from_data
andTexture::lazy_from_image
have been refactored
into constructors of a new type:
LazyTexture::from_data
/LazyTexture::from_image
.include_texture!
now returns aLazyTexture
instead of aTexture
.SharedTexture::region()
has been removed.TextureRegion::new()
is the
replacement API that allows creating a region for anyShareableTexture
.Sprite::load_aseprite_json
now acceptsimpl Into<ShareableTexture>
instead
of&SharedTexture
. In theory, no code will break from this change due to
trait implementations.SpriteSheet::texture
is now aShareableTexture
.
Added
-
app::PendingApp
is a type that allows opening one or more windows before
running an application. -
app::App
is a handle to a running application. -
app::Window::app()
returns a handle to the application of the window. -
WindowBehavior::open[_with]()
are new functions that allow opening a window
into a reference of anApp
orPendingApp
. -
CanRenderTo::can_render_to()
is a new trait that checks if a resource can be
rendered in a givenKludgine
instance.This is implemented by all types in Kludgine that utilize textures.
-
LazyTexture
is a new texture type that supports being shared across
different windows/wgpu rendering contexts by loading its data on-demand.
LazyTexture::upgrade()
loads aSharedTexture
that is compatible with the
given graphics context. -
ShareableTexture
is a texture type that can resolve to aSharedTexture
.
Currently this is either aSharedTexture
or aLazyTexture
. -
RunningWindow::close
is allows closing a window.
Fixed
- Internally, text drawing now uses weak references for the glyph handles to
preventwgpu
resources from being freed if aMeasuredText
was being held. - Each window now has its own
wgpu::Instance
instead of sharing a single
instance between windows. - Each
Window
frame now waits until it's fully rendered before yielding back
to the windqow loop. - When a
Window
has a 0 dimension, it will no longer try to redraw. This
presented as a panic when a window was minimized. - Subpixel alignment of text rendering is no longer accounted for twice. Additionally,
TextOrigin::Center
rounds the offset calculated to the nearest whole pixel. - A workaround has been added that caused clipping on the OpenGL backend to only
use the final scissor rect.