Releases: khonsulabs/kludgine
v0.11.0
Breaking Changes
App
is a new type that replaces the previous type alias pointing to
appit::App
. The previously exported type wasn't able to be used beyond
passing it as a parameter for opening additional windows. This new type
exposes additional winit information including monitor configurations.Window::ocluded
has had its spelling fixed and is nowWindow::occluded
.Window::position
has been renamed toWindow::outer_position
Window::set_position
has been renamed toWindow::set_outer_position
.
Fixed
Window
now calls winit'spre_present_notify()
before presenting the
surface.WindowHandle
'sClone
implementation no longer requires its generic
parameter to implementClone
.- Temporarily worked around a Wayland-only issue where window resize events are
not being generated from explicit window sizing requests.
Added
PendingApp::on_startup
executes a callback once the event loop has begun
executing.Monitors
,Monitor
, andVideoMode
are new types that offer information
about the monitor configurations available to the application. This
information can be retrieved from anApp
orExecutingApp
.WindowBehavior::moved
is invoked when the window is repositioned.Window::outer_size
is a new function that returns the window's size
including decorations.Window::inner_position
returns the position of the top-left of the content
area of the window.App::prevent_shutdown()
returns a guard that prevents the application from
closing automatically when the final window is closed.WindowBehavior::initialized
is invoked once the window has been fully
initialized.WindowBehavior::pre_initialize
is invoked before wgpu is initialized on the
window.
v0.10.0
Breaking Changes
-
Added Zoom setting to [
Kludgine
], allowing a second scaling factor to be
applied to all scaled operations. This change has affected these APIs:- [
Kludgine::resize()
]: Now takes an additional parameterzoom
. - [
Kludgine::scale()
]: Now returns an effective scale combining zoom and DPI
scaling. - [
Kludgine::dpi_scale()
]: A new function returning the currently set DPI
scale. - [
Kludgine::zoom()
]: A new function returning the current zoom value. - [
Kludgine::set_zoom()
]: A new function setting just the zoom value. - [
Kludgine::set_dpi_scale()
]: A new function setting just the DPI scale. - [`Graphics::set_zoom()]: A new function setting the zoom level for a
graphics context.
- [
Added
CornerRadii
now implementsfigures::Round
.
v0.9.0
Breaking Changes
wgpu
has been updated to22.0.0
.cosmic-text
has been updated to0.12.0
.
Added
WindowBehavior::memory_hints
is a new trait function that controls the
memory hintswgpu
is initialized with. The provided implementation returns
wgpu::MemoryHints::default()
.
v0.8.0
Breaking Changes
-
Frame::render_into
no longer takes aGraphics
parameter, but instead
accepts thewgpu::Queue
andwgpu::Device
parameters directly. Using
Graphics
causes lifetime issues in some rendering workflows. -
The
render
module has been renamed todrawing
to match the type it
contains. The old name was a remnant from whenDrawing
used to be named
Rendering
, which was incredibly confusing withRenderer
types around as
well. -
This crate now supports
wgpu
0.20.0. -
This crate now supports
cosmic-text
0.11.2. -
This crate now supports
image
0.25.1. -
These
WindowBehavior
functions have had a&Self::Context
parameter added
to them, ensuring each function where Kludgine is requesting information from
the implementor either receives an&self
or an&Self::Context
:WindowBehavior::power_preference()
WindowBehavior::limits()
WindowBehavior::multisample_count()
-
SpriteSheet::new()
now takes an additional parameter:gutter_size
. Passing
Size::ZERO
will cause the returned sprite sheet to be the same as before
this change.This new parameter allows using sprite sheets that have been exported with
consistent spacing between each sprite. -
These APIs now require exclusive references to the application:
WindowBehavior::open
WindowBehavior::open_with
-
These events have been renamed to match
winit
's nomenclature:WindowBehavior::touchpad_magnify
->WindowBehavior::pinch_gesture
WindowBehavior::smart_magnify
->WindowBehavior::double_tap_gesture
Changed
- All
&Appplication
bounds now are?Sized
, enabling&dyn Application
parameters. Color
now exposes its inneru32
as public.
Added
WindowBeahvior::pan_gesture
is a new event provided bywinit
.Kludgine::id()
returns the instance's unique id.Kludgine::REQUIRED_FEATURES
specifies the `wgpu::Features`` that Kludgine uses.Kludgine::adjust_limits()
adjustswgpu::Limits
to ensure Kludgine will
function.Texture::multisampled
allows creating aTexture
that can be used as a
multisample render attachment.Texture::copy[_rect]_to_buffer
are convenience helpers for copying image
data to awgpu::Buffer
.Texture::wgpu()
returns a handle to the underlyingwgpu::Texture
.Texture::view()
returns awgpu::TextureView
for the entire texture.- A new feature
plotters
enables integration with the excellent
plotters crate.Renderer::as_plot_area()
is a new function that
returns aplotters::DrawingArea
. Kludgine::rebuild_font_system()
is a new function that recreates the
cosmic_text::FontSystem
, which has the net effect of clearing font-database
related caches.WindowBehavior::present_mode()
allows a window to pick a different
presentation mode. The default implementation returns
wgpu::PresentMode::AutoVsync
.
Fixed
Drawing::render()
no longer makes any assumptions about the current clipping
rectangle when drawing is started.- Color correction for Srgb is now being done more accurately using the
palette
crate. This affects colors being applied to textures as tints and
shape drawing, but the Srgb handling of textures themselves remain handled
purely by wgpu. - Drawing text with an empty first line no longer panics.
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.
v0.6.1
Fixed
- A panic "Unsupported uniform datatype! 0x1405" has been resolved that occurred
on some devices where push constants were being emulated and only signed
integers were supported. - #66: A rounding error has been fixed when calculating the text width
would cause the line width to be rounded down in some cases. - If
wgpu
reports aSurfaceError::Lost
, thecreate_surface()
call is now
correctly made on the main thread rather than the window thread. Thanks to
@Plecra for reviewing the unsafe code and noticing this issue. This
review also led to further reductions in the amount of unsafe code and
improved the safety comments.
v0.6.0
This version is a complete rewrite. While some code was copied across, this
library now directly depends upon wgpu
instead of using easygpu
, and it has
an API inspired by wgpu
's Encapsulating Graphics Work
article.
v0.5.0
Breaking Changes
set_always_on_top
/with_always_on_top
/always_top
have been replaced with
set_window_level
/with_window_level
/window_level
respectively. This
change was due to upgrading to the latestwinit
.- The MSRV has been updated to 1.64.0 due to nested dependency requirements.
- These feature flags have been renamed:
serialization
has becomeserde
tokio-rt
has becometokio
smol-rt
has becomesmol
Changes
- Updated
easygpu
to v0.5.0.wgpu
has been updated to v0.16.0
winit
has been updated to v0.28.3palette
has been updated to v0.7.1
Fixes
- Returning a scale from
Window::additional_scale
now works. CloseResponse
is now exported.
Added
Scene::set_additional_scale
has been added to set the scaling factor between
Points and Scaled. This allows application-level scaling in addition to the
DPI scaling Kludgine already does.
v0.4.0
v0.3.1
This release fixes a compilation error after running cargo update
after rusttype
0.9.3 was released:
error[E0599]: no method named `family_name` found for reference `&std::sync::Arc<ttf_parser::Face<'_>>` in the current scope
--> core/src/text/font.rs:65:41
|
65 | rusttype::Font::Ref(f) => f.family_name(),
| ^^^^^^^^^^^ method not found in `&std::sync::Arc<ttf_parser::Face<'_>>`
Changes
- Updated
rusttype
to 0.9.3:ttf-parser
has been updated to 0.15.2.- Versions of rusttype are now pinned to prevent transient dependency upgrades
breaking compilation.