Releases: AustinJ235/basalt
Releases · AustinJ235/basalt
0.21.0
Version 0.21.0 (May 12, 2024)
This release involved rewriting a good portion of basalt, around 60%! There has been many bugs fixed and probably a few introduced. Basalt is now approaching the point where widgets are likely to be the next big feature release. There, however, may be some more refactoring regarding input handling to make a better distinction between key location and key name.
General Changes
- BREAKING:
vulkano
&vulkano-shaders
upgraded to0.34
- BREAKING:
ilmenite
has been removed. - BREAKING: Imports have been rearraged to allow everything to be accessed at a single module level.
- Ex:
use basalt::interface::bin::style::BinStyle;
is nowuse basalt::interface::BinStyle;
.
- Ex:
- BREAKING:
misc
module has been removed. - BREAKING:
image_view
module as its structBstImageView
has been removed.- These were used by these
Atlas
for tracking image usage. In vulkano 0.34 this functionality is no longer able to be implemented. It wasn't ever correct to begin with.
- These were used by these
- BREAKING: Removed feature
built_in_font
- System fonts will be used as a fallback/default instead.
winit
upgraded to0.29
- Added default feature
image_decode
which allows decoding of images using theimage
crate. - Added default feature
image_download
which allows downloading of images using thecurl
crate.
Changes to Basalt
- BREAKING:
initialize
now takesFnMut
directly instead ofBox
'd. - BREAKING: Removed
atlas
,atlas_ref
methods.- The atlas has been replaced by
ImageCache
. - Added methods
image_cache
andimage_cache_ref
.
- The atlas has been replaced by
- BREAKING: Removed
current_extent
,surface
,surface_ref
,window
, &window_ref
methods.- Now that basalt is multi-window these methods have been moved to the window/window_manager.
- Added methods
window_manager
&window_mangager_ref
.
- BREAKING: Removed
wait_for_exit
force_recreate_swapchain
,formats_in_use
,fps
, &poll_events
methods.Renderer
's will exit upon a close request.Renderer
's fully control their swapchain, removing the need for external event handling.Renderer
's have a configurable advance metrics which can provide stats such as fps.
- BREAKING:
BstFormatsInUse
,BstEvent
, &BstWinEv
removed. - BREAKING:
basalt_required_vk_features
is now removed as it is handled internally.
Changes to BasaltOptions
- BREAKING: Renamed
BstOptions
toBasaltOptions
. - BREAKING: Removed
app_loop
,bin_parallel_threads
,composite_alpha
conservative_draw
,ignore_dpi
,msaa
scale
,title
,use_exclusive_fullscreen
, &window_size
methods.- With the new window system and renderer these methods have been removed.
- Some of these options can be specified at window creation or methods on the window.
- Added
render_default_consv_draw
,render_default_msaa
,render_default_vsync
,render_default_worker_threads
,window_default_scale
, &window_ignore_dpi
methods.
- BREAKING:
force_unix_backend_x11
renamed towinit_force_x11
. - BREAKING: Removed
imt_fill_quality
,imt_gpu_accelerated
, &imt_sample_quality
methods.ilmenite
is no longer used so these methods are obsolete.
- BREAKING: Removed
device_ext_union
,instance_ext_union
,with_features
methods.- Added methods
prefer_device_extensions
,prefer_device_features
,prefer_instance_extensions
,require_device_features
,require_device_extensions
, &require_instance_extensions
. - The new methods allow features/extensions to be more configurable.
- Added methods
- BREAKING: Portability subset devices now must be allowed via the
allow_portability_subset
method. - Added method
add_binary_font
for loading fonts during initialization.
Changes to Interface
- BREAKING: Methods
default_font
&set_default_font
now use theDefaultFont
struct. - BREAKING: Removed
has_font
method. - BREAKING: Removed
current_effective_scale
,current_msaa
,current_scale
,decrease_msaa
,increase_msaa
,set_effective_scale
,set_msaa
, &set_scale
methods.- Now with multi-window support similar methods now exist on
Window
.
- Now with multi-window support similar methods now exist on
- BREAKING:
add_font
has been replaced byadd_binary_font
. - BREAKING:
draw
method has been removed asRenderer
now does the drawing.
Changes to BinStyle
- BREAKING: Added field
child_float_mode
& enumChildFloatMode
for configuring float style. - BREAKING:
back_image
field now takes anImageCacheKey
instead of a path. - BREAKING:
back_image_url
,back_image_atlas
, &back_image_cache
fields removed. - BREAKING:
back_image_raw
&back_image_raw_coords
have been replaced byback_image_vk
&back_image_coords
. - BREAKING:
text_wrap
field now takesTextWrap
instead ofImtTextWrap
. - BREAKING:
text_vert_align
field now takesTextVertAlign
instead ofImtVertAlign
. - BREAKING:
text_hori_align
field now takesTextHoriAlign
instead ofImtHoriAlign
. - BREAKING: Added fields
font_weight
,font_stretch
, &font_style
for further selection of fonts. - Added support for borders with border radius.
Changes to Color
- BREAKING:
srgb_hex
has been renamed toshex
. - BREAKING:
from_hex
has been renamed tohex
. - BREAKING:
clamp
,to_linear
, &to_nonlinear
methods removed. - BREAKING:
as_array
has been renamed torgbaf_array
. - Added many more constructor methods.
- Includes standard/linear u8/u16/f32 color formats.
- Added support for constructing from an hsl/hsla color.
- Added many more conversion methods converting to an array of various types.
- Added methods for construction of standard svg colors.
Changes to Bin
- BREAKING: Removed
add_button_fade_events
. - BREAKING: Replaced
force_update
,update_children
, &force_recursive_update
withtrigger_update
,trigger_children_update
, &trigger_recursive_update
.- The methods have been rework internally and have been renamed to be match what they do.
- It should be noted however that having to use these methods generally means there is a bug in basalt.
- BREAKING:
hidden
&visible
methods have been replaced withset_hidden
&is_hidden
. - BREAKING:
keep_alive
method no longer requires objects withKeepAlive
trait. - BREAKING: Removed
update_stats
method.- Stats are now done within the
Renderer
and can be configured by theWindow
.
- Stats are now done within the
- Added
associate_window
,associate_window_recursive
, &window
methods.- Now that
Bin
's must be associated with a window these methods provide the means to do that. It is still preferred however to createBin
via theWindow
.
- Now that
- Added method
children_recursive_with_self
. - Added method
style_inspect
which allows inspecting a style without cloning anArc
. - Various bug fixes regarding placement, overflow, and update triggering.
Changes to BinPostUpdate
- BREAKING: Renamed
PostUpdate
toBinPostUpdate
. - BREAKING: Added fields
visible
&floating
. - BREAKInG:
unbound_mm_y
&unbound_mm_x
fields have been replaced byoptimal_inner_bounds
,optimal_outer_bounds
,content_bounds
, &optimal_content_bounds
as part of the rework in overflow calculations.
Changes to Images
- BREAKING:
Atlas
has been replaced byImageCache
. ImageCache
has similar methods for loading images.- Images are now referenced by their
ImageCacheKey
instead ofAtlasCoords
.
Changes to Windows
- BREAKING: basalt no longer automatically creates a window upon initialization.
- BREAKING:
BasaltWindow
trait has been removed. - Added
WindowManager
which is responsible for creatingWindow
's and handling their events.
Changes to Rendering
- BREAKING: Drawing is no longer done with the
Interface::draw
method. - Added
Renderer
which handles all the rendering of aWindow
.
0.20.0
- BREAKING Update dependency
vulkano
&vulkano-shaders
to0.33
. - BREAKING Update dependency
ilmenite
to0.14
. - BREAKING Removed
enable_validation
fromBstOptions
. - Update dependency
winit
to0.28
.
0.19.1
- Fixed non-uniform access in interface shader.
- Fixed bug with slider not releasing when mouse left button is released.
- Fixed bug with slider calling on change methods when there wasn't a change.
0.19.0
- BREAKING Update dependency
vulkano
&vulkano-shaders
to0.32
. - Custom Font Support
- BREAKING
BinStyle
now hasfont_family
&font_weight
fields. - Added default feature
built_in_font
that allows disabling loading/including of built-in font. Interface
now hasdefault_font
,set_default_font
&add_font
methods.
- BREAKING
- Changes to
BinStyle
updates/validation.- BREAKING
Bin::style_update
now returnsBinStyleValidation
which must be used.- Introduced non-default feature
style_validation_debug_on_drop
which will use thedebug
method ofBinStyleValidation
upon dropping. This also removes the#[must_use]
attribute ofBinStyleValidation
.
- Introduced non-default feature
- Supress warnings about body being too small when using text.
- BREAKING
- BREAKING Removed
seperate_
image methods onBin
.- Using seperate images not provided by the atlas should use the
back_image_raw
style ofBinStyle
. - BREAKING Removed
back_srgb_yuv
field fromBinStyle
.- This wasn't proper
yuv
supported as probably not used. For those that may be using this either use theAtlas
for yuv conversion or convert the image to RGB and use theback_image_raw
field.
- This wasn't proper
- Using seperate images not provided by the atlas should use the
- Added method
window_ref
toBasalt
.
0.18.0
- BREAKING Update dependency
vulkano
&vulkano-shaders
to0.30
. - BREAKING Update dependency
ilmenite
to0.12
. - BREAKING
Input
andHookManager
(a.k.a.BinHook
) have been rewritten/merged.- As this is a rewrite, the design has changed greatly. Please refer to docs.
- Convenience methods on
Input
are now accessed on windows instead.- For example a press can be added via
basalt.window().on_press(...)
.
- For example a press can be added via
- Convenience methods on
Bin
have had their named changed and some additional ones added.- For example
bin.on_mouse_press(...)
is nowbin.on_press(...)
.
- For example
- More specific/customized hooks are created via builders accessed by
Input.hook()
. - Hook method signatures have changed away from an enum style and now have specific signatures for each type of hook.
- Most data available for hooks is still available, but is accessed differently.
on_hold
is an exception where querying the cursor position, or any other window state, is no longer available.
- The concept of weights are now implemented.
- This allows hooks to be processed in certain order and block the calling of other hooks of the same class. Refer to the docs for more specfic details on how this system works.
- BREAKING
BinStyle.pass_events
is now removed.- This has been removed in favor of the weight system.
- This was introduced originally as sort of hack for having scrollable content within other scrollable content.
- Specifically
InputScrollBuilder.upper_blocks(...)
replaces this hack.
- Specifically
- BREAKING
BinID
is now a concrete type instead of an alias. - BREAKING
Interface.get_bin_id_atop(...)
andInterface.get_bin_atop(...)
now additionally take aBstWindowID
. - BREAKING
ImageEffect
now hasGlyphWithColor
varient. - BREAKING Removed
Basalt::physical_device_index()
asvulkano
no longer has indexes for physical devices. - Interface now has the methods
get_bins_atop(...)
andget_bin_ids_atop
which function like their singular varients, but return a sortedVec
instead where the top most is first. - New
Interval
system- This system introduces the ability to run a hook on a specfic interval down to 1 ms of precision.
- The minimum resolution is platform/scheduler specific, but generally Windows is about 1.4ms and linux at 1 ms.
- The rewritten
Input
system utilizes this functionality withon_hold
andon_scroll
, where smooth scrolling is enabled, to provide more frequent and consistent intervals.
- This system introduces the ability to run a hook on a specfic interval down to 1 ms of precision.
- Changed font used to a more common, less quirky font Roboto.
- Improved subpixel sampling for glyphs in interface shaders.
- Added method
Basalt::physical_device_ref()
.
0.17.0
Atlas
now internally uses theguillotiere
crate for allocation.atlas::Coords
has been reworked.- BREAKING Renamed to
AtlasCoords
to reduce name conflicts. - BREAKING All fields are now private.
- BEHAVIOR
AtlasCoords
is now required to be kept alive for the coordinates to be valid.- Upon dropping
AtlasCoords
deletion may occur depending on behavior defined byAtlasCacheCtrl
upon adding an image to theAtlas
.
- Upon dropping
- Added
external
method to allow construction for use inBinStyle.back_image_raw_coords
and other use cases. - Added
is_external
method to check ifAtlasCoords
was created viaexternal
. - Added
none
method to create none/invalidAtlasCoords
for use as a placeholder. - Added
is_none
to check ifAtlasCoords
was created vianone
. - Added
image_id
method to get theAtlasImageID
. - Added
tlwh
for getting the top-left-width-height, size/position. - Internal positional and dimensional fields are represented as
f32
instead ofu32
to reduce coercion.
- BREAKING Renamed to
Atlas
image removal support.- Added enum
AtlasCacheCtrl
to define behavior around removal. - BREAKING
Atlas
methodsload_image
,load_image_from_bytes
,load_image_from_path
, andload_image_from_url
now additionally takesAtlasCacheCtrl
as an argument. - BREAKING Added
BinStyle
fieldback_image_cache
to specifyAtlasCacheCtrl
used for various back image sources.
- Added enum
- BREAKING All methods taking signature of
Arc<Fn(_) -> _ + Send + Sync>
now takeFnMut(_) -> _ + Send + 'static
.- In most cases wrapping a closure in an
Arc
was arbitrary.- For users wanting to reuse functions:
- Option A: Define function if there isn't a need to send variables to within the closure.
- Option B: Call the
Arc<Fn(_) -> _ + ...>
from a closure,|args| arcd_fn(args)
.
- For users wanting to reuse functions:
- This change removes the need for
Sync
in types. 'static
maybe appear as an additional requirment, but was previously implied.FnMut
is now used instead ofFn
allowing state to be kept without the need of synchronization primatives.
- In most cases wrapping a closure in an
- BREAKING
InputHookFn
type alias has been removed. - BREAKING
InputHookRes
has been renamed toInputHookCtrl
.- BREAKING
Error
&Warning
varients are now removed.- Users should instead print the message themselves.
- BREAKING
Success
varient has been renamed toRetain
. InputHookCtrl
now implementsDefault
and will default toRetain
.
- BREAKING
- BREAKING
BinHookFn
type alias has been removed. - BREAKING
Bin::add_hook_raw
has been renamed toBin::add_hook
. - BREAKING
Bin::on_update
&Bin::on_update_once
now takeFnMut(bin: &Arc<Bin>, post_update: &PostUpdate)
. - BREAKING
CheckBox::on_change
no longer spawns a thread to call method. - BREAKING
Slider::on_change
no longer spawns a thread to call method. - BREAKING
Atlas::new()
now takesArc<Queue>
,VkFormat
,max_alloc_size: u32
instead ofArc<Basalt>
. - BREAKING
basalt::Options
has been renamed toBstOptions
. - BREAKING
basalt::Limits
and the associated methodBasalt::limits()
has been removed.- Use
Basalt::physical_device().properties()
instead.
- Use
- BREAKING
InputHookData::Character { .. }
is nowInputHookData::Character(char)
andBinHookData::Character { .. }
is nowBinHookData::Character(char)
.- No longer mapped from scan code. This allows non-US languages to work.
- Use
'\r'
to detect new lines and'\u{8}'
for backspaces.
- BREAKING Removed
Qwerty::into_char()
.- This was not proper to begin within. If you need to receive characters, use either
InputHook::Character
orBinHook::Character
.
- This was not proper to begin within. If you need to receive characters, use either
- BREAKING Removed methods
resize
,enable_fullscreen
,disable_fullscreen
, andtoggle_fullscreen
fromBasalt
.- Used methods on
BasaltWindow
returned byBasalt::window()
instead.
- Used methods on
- BREAKING
BasaltWindow::enable_fullscreen()
now takesFullScreenBehavior
as an argument and returnsResult<(), FullScreenError>
. - BREAKING
SubImageCacheID::Glyph
is now a struct not a tuple. AtlasImage
now has theload_from_bytes
,load_from_path
,load_from_url
methods that are used by the correspondingAtlas
methods.BstImageView
now has theset_drop_fn
for setting a method to be called when all temporary views are dropped.BinPosition
,BstEvent
, &BstWinEv
types that already derivedPartialEq
now also deriveEq
.- Fixed bug when input hooks return'd
InputHookRes::Remove
(nowInputHookCtrl::Remove
) it didn't actually do anything. Bin
now hason_children_added
&on_children_removed
methods.- Removed
unsafe
code fromBasalt
initialization which caused undefined behavior. - Added
BstOptions::bin_parallel_threads
to specify amount of parallel threads used forBin
updates. - Update dependancy
winit
to0.27.2
. - Additional
BasaltWindow
methods where added:is_fullscreen()
: check if the window is in fullscreen.monitors()
: returns a list of monitors.- Introduces
Monitor
andMonitorMode
used inFullScreenBehavior
.
- Introduces
primary_monitor()
returns the primary monitor if determinable.current_monitor()
returns the current monitor if determinable.
0.16.1
- Fixed VUID-vkCmdDraw-None-02703 & VUID-vkCmdDraw-None-02699 validation errors.
0.16.0
- BREAKING Update dependency
vulkano
&vulkano-shaders
to0.30
. - BREAKING Update dependency
ilmenite
to0.11
. - BREAKING
BstFormatsInUse
now hasswapchain
&swapchain_colorspace
fields used primary for app loop applications. This can double as a recommended swapchain format for other applications. - BREAKING
misc
methodspartial_ord_min
,partial_ord_min3
,partial_ord_max
, &partial_ord_max3
have been removed. - BREAKING
PostUpdate
fieldspre_bound_min_y
&pre_bound_max_y
have been replaced withunbound_mm_y
. - BREAKING
Bin::calc_overflow
has been renamed tocalc_vert_overflow
. - BEHAVIOR
overflow_x
&scroll_x
are now implemented onBinStyle
. Previously overflowing horizontal content will now be removed.- Usage
overflow_x: Some(true)
to revert this behavior where needed.
- Usage
- Added
conservative_draw
method toOptions
. This is currently experimental and will attempt to limit interface redraws for app loop applications. - Fixed bug where if MSAA was in use with
ItfDrawTarget::Image
an error would occur. - Fixed bug where overflow on a
Bin
was not calculated correctly withcalc_vert_overflow
method. PostUpdate
added fieldunbound_mm_x
for min/max of horizontal content before bound (overflow removal).Bin
now hascalc_hori_overflow
method.- Fixed bug where alternative
Atlas
formats weren't actually supported. - Fixed bug where atlas formats were not checked for
transfer_src
support. - Fixed bug where
OnOffButton
would never drop. atlas::Image
now hasto_8b_srgba
&to_8b_lrgba
methods.
0.15.0
- BREAKING Update dependency
vulkano
&vulkano-shaders
to0.29
. - BREAKING
Basalt::swap_caps()
has been replaced byBasalt::surface_capabilities
,Basalt::surface_formats
, &Basalt::surface_present_modes
. - BREAKING
Basalt::current_extent()
now takesFullScreenExclusive
as an argument. - BREAKING Renamed
Qwery
toQwerty
... - BREAKING
BinColor::as_tuple()
has been removed and replaced byBinColor::as_array()
. - BREAKING
atlas::Coords
methodstop_left
,top_right
,bottom_left
, &bottom_right
now return[f32; 2]
instead of(f32, f32)
. - BEHAVIOR
Camera::mouse_inside()
will now return false forBin
's that havepass_events
set toSome(true)
. - Fixed various instances of buffers being created with zero size.
- Fixed wrong image values for Atlas's empty image.
- Refactored queue creation to have weights more inline with vulkan spec.
0.12.0
- BREAKING Update dependency
ilmenite
to0.7.0
. - BREAKING Update dependency
vulkano
&vulkano-shaders
to0.26
. - BREAKING Atlas has been reworked
- BREAKING Renamed method
default_sampler
tolinear_sampler
. - Now uses 16 bit Linear formats for images instead of 8 bit SRGB.
- Added method
nearest_sampler
that provides a nearest filter sampler. - Methods
load_image_from_bytes
,load_image_from_path
, &load_image_from_url
now support loading of 16 bit images fully instead of converting them to 8 bit. - Secondary graphics queue will be used instead of compute queue when available and will fallback to the primary graphics queue. This is needed as blit operations need to be done on a queue with support for blit operations.
ImageData
- BREAKING No longer nonexhaustive.
- BREAKING Added Varients
D16
: 16 bit imagesImt
forImtImageView
.Bst
forBstImageView
.
ImageType
- BREAKING No longer has
Glyph
varient. UseSMono
. - BREAKING Added
Raw
varient that is used forImage
's constructed fromfrom_bst
&from_imt
.
- BREAKING No longer has
Image
- Now implements
Debug
andClone
. - New constructors
from_bst
for construction fromBstImageView
.from_imt
for construction fromImtImageView
.
- BREAKING
to_srgba
has been renamed toto_16b_srgba
which convertsImage
to one constructed ofImageType::SRGBA
&ImageData::D16
. This does not effectImage
's ofImageType::Raw
. - BREAKING
to_lrgba
has been renamed toto_16b_lrgba
which convertsImage
to one constructed ofImageType::LRGBA
&ImageData::D16
. This does not effectImage
's ofImageType::Raw
.
- Now implements
- BREAKING Renamed method
- BREAKING Interface rendering has been reworked.
- BREAKING Moved
interface::interace
intointerface
. - BREAKING
ItfRenderer
is no longer public. Its public facing functionality is now moved toInterface
viadraw
.- Draw method now takes a command buffer builder and a
ItfDrawTarget
.ItfDrawTarget
replaces the previouswin_size
,resize
,swap_imgs
,render_to_swapchain
&image_num
.- This limits the amount of fields only to what is required.
- i.e.
ItfDrawTarget::Image
only needs an extent.
- i.e.
- It is no longer required to pass resize when the swapchain is recreated or resized. Given the context the renderer will automatically recreate the target when needed.
ItfDrawTarget
also hasSwapchainWithSource
which is recommended when doing additional graphics on top of basalt. This will render the source in the background and have proper blending with component aware alpha. This replaces the need to have a seperate pipeline where the end user would have to have a seperate pipeline to combine their image with Basalt's.
- Draw method now takes a command buffer builder and a
- New rendering is done on a layer basis with component aware alpha blending which allows for more correct alpha blending and text blending along with more advance rendering features to come.
- BREAKING Moved
- BREAKING
BstImageView
temporary views have been reworked.- BREAKING
create_tmp
no longer returns anAtomicBool
. - Added method
temporary_views
to fetch the amount of temporary views. - Added method
mark_stale
to mark the image view stale.- This is used on the parent view to hint to owners of temporary views that the view that is provided is stale and should be replaced.
- Added method
is_stale
to check if the view is stale.- Check if the owner view has marked this view stale. If true the view should be replaced or dropped as soon as possible.
- BREAKING
- BREAKING
Options
no longer hasinterface_limit_draw
. Limiting the draw had weird quirks and is removed for the time being. - BREAKING
input::Event::WindowScale
now expects scale to be provided. - BREAKING
BstMSAALevel
has been moved into theinterface
mod. - BREAKING
BstEvent::BstItfEv
&BstItfEv
are no longer. - BREAKING Changed how scale & msaa are accessed and handled.
- BREAKING
Basalt::current_scale()
has been moved toInterface::current_scale()
. - BREAKING
Basalt::set_scale()
has been moved toInteface::set_scale()
. - BREAKING
Basalt::add_scale()
has been removed. - BREAKING
Interface::msaa()
method has been renamed tocurrent_msaa
. Interface
now has the following methods added:current_effective_scale
: current scale taking into account dpi window scaling.set_effective_scale
: set the scale taking into account dpi window scaling.
- BREAKING
Options
now hasimt_gpu_accelerated
to select whether ilmenite will use gpu accerated font rasterization.imt_fill_quality
to select the fill quality for ilmenite, andimt_sample_quality
to select the sample quality for ilmenite.- Fixed bug where glyph alignment was incorrect when scale was not 100%.
- Bins will now load images into the atlas directly from ilmenite.
- Interface shader will now use nearest filter sampler when sampling glyph images. This resolves issues with subpixel hinting being incorrect.