Skip to content

Releases: khonsulabs/kludgine

v0.11.0

14 Sep 17:58
e82af05
Compare
Choose a tag to compare

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 now Window::occluded.
  • Window::position has been renamed to Window::outer_position
  • Window::set_position has been renamed to Window::set_outer_position.

Fixed

  • Window now calls winit's pre_present_notify() before presenting the
    surface.
  • WindowHandle's Clone implementation no longer requires its generic
    parameter to implement Clone.
  • 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, and VideoMode are new types that offer information
    about the monitor configurations available to the application. This
    information can be retrieved from an App or ExecutingApp.
  • 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

20 Aug 19:08
98de7c0
Compare
Choose a tag to compare

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 parameter zoom.
    • [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 implements figures::Round.

v0.9.0

20 Aug 19:08
e0c407a
Compare
Choose a tag to compare

Breaking Changes

  • wgpu has been updated to 22.0.0.
  • cosmic-text has been updated to 0.12.0.

Added

  • WindowBehavior::memory_hints is a new trait function that controls the
    memory hints wgpu is initialized with. The provided implementation returns
    wgpu::MemoryHints::default().

v0.8.0

12 May 15:28
841e64d
Compare
Choose a tag to compare

Breaking Changes

  • Frame::render_into no longer takes a Graphics parameter, but instead
    accepts the wgpu::Queue and wgpu::Device parameters directly. Using
    Graphics causes lifetime issues in some rendering workflows.

  • The render module has been renamed to drawing to match the type it
    contains. The old name was a remnant from when Drawing used to be named
    Rendering, which was incredibly confusing with Renderer 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 inner u32 as public.

Added

  • WindowBeahvior::pan_gesture is a new event provided by winit.
  • Kludgine::id() returns the instance's unique id.
  • Kludgine::REQUIRED_FEATURES specifies the `wgpu::Features`` that Kludgine uses.
  • Kludgine::adjust_limits() adjusts wgpu::Limits to ensure Kludgine will
    function.
  • Texture::multisampled allows creating a Texture that can be used as a
    multisample render attachment.
  • Texture::copy[_rect]_to_buffer are convenience helpers for copying image
    data to a wgpu::Buffer.
  • Texture::wgpu() returns a handle to the underlying wgpu::Texture.
  • Texture::view() returns a wgpu::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 a plotters::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

28 Dec 03:02
a44e14d
Compare
Choose a tag to compare

Breaking Changes

  • UnwindSafe has been removed from the bounds of WindowBehavior::Context,
    and various types may or may no longer implmement UnwindSafe. The underlying
    requirement for this has been removed from appit.
  • Texture::lazy_from_data and Texture::lazy_from_image have been refactored
    into constructors of a new type:
    LazyTexture::from_data/LazyTexture::from_image.
  • include_texture! now returns a LazyTexture instead of a Texture.
  • SharedTexture::region() has been removed. TextureRegion::new() is the
    replacement API that allows creating a region for any ShareableTexture.
  • Sprite::load_aseprite_json now accepts impl Into<ShareableTexture> instead
    of &SharedTexture. In theory, no code will break from this change due to
    trait implementations.
  • SpriteSheet::texture is now a ShareableTexture.

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 an App or PendingApp.

  • CanRenderTo::can_render_to() is a new trait that checks if a resource can be
    rendered in a given Kludgine 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 a SharedTexture that is compatible with the
    given graphics context.

  • ShareableTexture is a texture type that can resolve to a SharedTexture.
    Currently this is either a SharedTexture or a LazyTexture.

  • RunningWindow::close is allows closing a window.

Fixed

  • Internally, text drawing now uses weak references for the glyph handles to
    prevent wgpu resources from being freed if a MeasuredText 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

19 Dec 22:52
839e123
Compare
Choose a tag to compare

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 a SurfaceError::Lost, the create_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

18 Dec 19:10
bb9ab3b
Compare
Choose a tag to compare

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

28 Apr 16:28
ebf9360
Compare
Choose a tag to compare

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 latest winit.
  • The MSRV has been updated to 1.64.0 due to nested dependency requirements.
  • These feature flags have been renamed:
    • serialization has become serde
    • tokio-rt has become tokio
    • smol-rt has become smol

Changes

  • Updated easygpu to v0.5.0.
    • wgpu has been updated to v0.16.0
  • winit has been updated to v0.28.3
  • palette 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

27 Jan 19:30
9c64408
Compare
Choose a tag to compare

Changes

  • Updated easygpu to 0.4.0:
    • wgpu has been updated to 0.15.0.

v0.3.1

06 Nov 15:17
797cef2
Compare
Choose a tag to compare

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.