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-shadersupgraded to0.34 - BREAKING:
ilmenitehas 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:
miscmodule has been removed. - BREAKING:
image_viewmodule as its structBstImageViewhas been removed.- These were used by these
Atlasfor 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.
winitupgraded to0.29- Added default feature
image_decodewhich allows decoding of images using theimagecrate. - Added default feature
image_downloadwhich allows downloading of images using thecurlcrate.
Changes to Basalt
- BREAKING:
initializenow takesFnMutdirectly instead ofBox'd. - BREAKING: Removed
atlas,atlas_refmethods.- The atlas has been replaced by
ImageCache. - Added methods
image_cacheandimage_cache_ref.
- The atlas has been replaced by
- BREAKING: Removed
current_extent,surface,surface_ref,window, &window_refmethods.- 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_exitforce_recreate_swapchain,formats_in_use,fps, &poll_eventsmethods.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, &BstWinEvremoved. - BREAKING:
basalt_required_vk_featuresis now removed as it is handled internally.
Changes to BasaltOptions
- BREAKING: Renamed
BstOptionstoBasaltOptions. - BREAKING: Removed
app_loop,bin_parallel_threads,composite_alphaconservative_draw,ignore_dpi,msaascale,title,use_exclusive_fullscreen, &window_sizemethods.- 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_dpimethods.
- BREAKING:
force_unix_backend_x11renamed towinit_force_x11. - BREAKING: Removed
imt_fill_quality,imt_gpu_accelerated, &imt_sample_qualitymethods.ilmeniteis no longer used so these methods are obsolete.
- BREAKING: Removed
device_ext_union,instance_ext_union,with_featuresmethods.- 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_subsetmethod. - Added method
add_binary_fontfor loading fonts during initialization.
Changes to Interface
- BREAKING: Methods
default_font&set_default_fontnow use theDefaultFontstruct. - BREAKING: Removed
has_fontmethod. - BREAKING: Removed
current_effective_scale,current_msaa,current_scale,decrease_msaa,increase_msaa,set_effective_scale,set_msaa, &set_scalemethods.- Now with multi-window support similar methods now exist on
Window.
- Now with multi-window support similar methods now exist on
- BREAKING:
add_fonthas been replaced byadd_binary_font. - BREAKING:
drawmethod has been removed asRenderernow does the drawing.
Changes to BinStyle
- BREAKING: Added field
child_float_mode& enumChildFloatModefor configuring float style. - BREAKING:
back_imagefield now takes anImageCacheKeyinstead of a path. - BREAKING:
back_image_url,back_image_atlas, &back_image_cachefields removed. - BREAKING:
back_image_raw&back_image_raw_coordshave been replaced byback_image_vk&back_image_coords. - BREAKING:
text_wrapfield now takesTextWrapinstead ofImtTextWrap. - BREAKING:
text_vert_alignfield now takesTextVertAligninstead ofImtVertAlign. - BREAKING:
text_hori_alignfield now takesTextHoriAligninstead ofImtHoriAlign. - BREAKING: Added fields
font_weight,font_stretch, &font_stylefor further selection of fonts. - Added support for borders with border radius.
Changes to Color
- BREAKING:
srgb_hexhas been renamed toshex. - BREAKING:
from_hexhas been renamed tohex. - BREAKING:
clamp,to_linear, &to_nonlinearmethods removed. - BREAKING:
as_arrayhas 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_updatewithtrigger_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&visiblemethods have been replaced withset_hidden&is_hidden. - BREAKING:
keep_alivemethod no longer requires objects withKeepAlivetrait. - BREAKING: Removed
update_statsmethod.- Stats are now done within the
Rendererand can be configured by theWindow.
- Stats are now done within the
- Added
associate_window,associate_window_recursive, &windowmethods.- Now that
Bin's must be associated with a window these methods provide the means to do that. It is still preferred however to createBinvia theWindow.
- Now that
- Added method
children_recursive_with_self. - Added method
style_inspectwhich allows inspecting a style without cloning anArc. - Various bug fixes regarding placement, overflow, and update triggering.
Changes to BinPostUpdate
- BREAKING: Renamed
PostUpdatetoBinPostUpdate. - BREAKING: Added fields
visible&floating. - BREAKInG:
unbound_mm_y&unbound_mm_xfields have been replaced byoptimal_inner_bounds,optimal_outer_bounds,content_bounds, &optimal_content_boundsas part of the rework in overflow calculations.
Changes to Images
- BREAKING:
Atlashas been replaced byImageCache. ImageCachehas similar methods for loading images.- Images are now referenced by their
ImageCacheKeyinstead ofAtlasCoords.
Changes to Windows
- BREAKING: basalt no longer automatically creates a window upon initialization.
- BREAKING:
BasaltWindowtrait has been removed. - Added
WindowManagerwhich is responsible for creatingWindow's and handling their events.
Changes to Rendering
- BREAKING: Drawing is no longer done with the
Interface::drawmethod. - Added
Rendererwhich handles all the rendering of aWindow.
0.20.0
- BREAKING Update dependency
vulkano&vulkano-shadersto0.33. - BREAKING Update dependency
ilmeniteto0.14. - BREAKING Removed
enable_validationfromBstOptions. - Update dependency
winitto0.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-shadersto0.32. - Custom Font Support
- BREAKING
BinStylenow hasfont_family&font_weightfields. - Added default feature
built_in_fontthat allows disabling loading/including of built-in font. Interfacenow hasdefault_font,set_default_font&add_fontmethods.
- BREAKING
- Changes to
BinStyleupdates/validation.- BREAKING
Bin::style_updatenow returnsBinStyleValidationwhich must be used.- Introduced non-default feature
style_validation_debug_on_dropwhich will use thedebugmethod ofBinStyleValidationupon 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_rawstyle ofBinStyle. - BREAKING Removed
back_srgb_yuvfield fromBinStyle.- This wasn't proper
yuvsupported as probably not used. For those that may be using this either use theAtlasfor yuv conversion or convert the image to RGB and use theback_image_rawfield.
- This wasn't proper
- Using seperate images not provided by the atlas should use the
- Added method
window_reftoBasalt.
0.18.0
- BREAKING Update dependency
vulkano&vulkano-shadersto0.30. - BREAKING Update dependency
ilmeniteto0.12. - BREAKING
InputandHookManager(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
Inputare 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
Binhave 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_holdis 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_eventsis 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
BinIDis now a concrete type instead of an alias. - BREAKING
Interface.get_bin_id_atop(...)andInterface.get_bin_atop(...)now additionally take aBstWindowID. - BREAKING
ImageEffectnow hasGlyphWithColorvarient. - BREAKING Removed
Basalt::physical_device_index()asvulkanono longer has indexes for physical devices. - Interface now has the methods
get_bins_atop(...)andget_bin_ids_atopwhich function like their singular varients, but return a sortedVecinstead where the top most is first. - New
Intervalsystem- 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
Inputsystem utilizes this functionality withon_holdandon_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
Atlasnow internally uses theguillotierecrate for allocation.atlas::Coordshas been reworked.- BREAKING Renamed to
AtlasCoordsto reduce name conflicts. - BREAKING All fields are now private.
- BEHAVIOR
AtlasCoordsis now required to be kept alive for the coordinates to be valid.- Upon dropping
AtlasCoordsdeletion may occur depending on behavior defined byAtlasCacheCtrlupon adding an image to theAtlas.
- Upon dropping
- Added
externalmethod to allow construction for use inBinStyle.back_image_raw_coordsand other use cases. - Added
is_externalmethod to check ifAtlasCoordswas created viaexternal. - Added
nonemethod to create none/invalidAtlasCoordsfor use as a placeholder. - Added
is_noneto check ifAtlasCoordswas created vianone. - Added
image_idmethod to get theAtlasImageID. - Added
tlwhfor getting the top-left-width-height, size/position. - Internal positional and dimensional fields are represented as
f32instead ofu32to reduce coercion.
- BREAKING Renamed to
Atlasimage removal support.- Added enum
AtlasCacheCtrlto define behavior around removal. - BREAKING
Atlasmethodsload_image,load_image_from_bytes,load_image_from_path, andload_image_from_urlnow additionally takesAtlasCacheCtrlas an argument. - BREAKING Added
BinStylefieldback_image_cacheto specifyAtlasCacheCtrlused 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
Arcwas 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
Syncin types. 'staticmaybe appear as an additional requirment, but was previously implied.FnMutis now used instead ofFnallowing state to be kept without the need of synchronization primatives.
- In most cases wrapping a closure in an
- BREAKING
InputHookFntype alias has been removed. - BREAKING
InputHookReshas been renamed toInputHookCtrl.- BREAKING
Error&Warningvarients are now removed.- Users should instead print the message themselves.
- BREAKING
Successvarient has been renamed toRetain. InputHookCtrlnow implementsDefaultand will default toRetain.
- BREAKING
- BREAKING
BinHookFntype alias has been removed. - BREAKING
Bin::add_hook_rawhas been renamed toBin::add_hook. - BREAKING
Bin::on_update&Bin::on_update_oncenow takeFnMut(bin: &Arc<Bin>, post_update: &PostUpdate). - BREAKING
CheckBox::on_changeno longer spawns a thread to call method. - BREAKING
Slider::on_changeno longer spawns a thread to call method. - BREAKING
Atlas::new()now takesArc<Queue>,VkFormat,max_alloc_size: u32instead ofArc<Basalt>. - BREAKING
basalt::Optionshas been renamed toBstOptions. - BREAKING
basalt::Limitsand 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::CharacterorBinHook::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_fullscreenfromBasalt.- Used methods on
BasaltWindowreturned byBasalt::window()instead.
- Used methods on
- BREAKING
BasaltWindow::enable_fullscreen()now takesFullScreenBehavioras an argument and returnsResult<(), FullScreenError>. - BREAKING
SubImageCacheID::Glyphis now a struct not a tuple. AtlasImagenow has theload_from_bytes,load_from_path,load_from_urlmethods that are used by the correspondingAtlasmethods.BstImageViewnow has theset_drop_fnfor setting a method to be called when all temporary views are dropped.BinPosition,BstEvent, &BstWinEvtypes that already derivedPartialEqnow also deriveEq.- Fixed bug when input hooks return'd
InputHookRes::Remove(nowInputHookCtrl::Remove) it didn't actually do anything. Binnow hason_children_added&on_children_removedmethods.- Removed
unsafecode fromBasaltinitialization which caused undefined behavior. - Added
BstOptions::bin_parallel_threadsto specify amount of parallel threads used forBinupdates. - Update dependancy
winitto0.27.2. - Additional
BasaltWindowmethods where added:is_fullscreen(): check if the window is in fullscreen.monitors(): returns a list of monitors.- Introduces
MonitorandMonitorModeused 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-shadersto0.30. - BREAKING Update dependency
ilmeniteto0.11. - BREAKING
BstFormatsInUsenow hasswapchain&swapchain_colorspacefields used primary for app loop applications. This can double as a recommended swapchain format for other applications. - BREAKING
miscmethodspartial_ord_min,partial_ord_min3,partial_ord_max, &partial_ord_max3have been removed. - BREAKING
PostUpdatefieldspre_bound_min_y&pre_bound_max_yhave been replaced withunbound_mm_y. - BREAKING
Bin::calc_overflowhas been renamed tocalc_vert_overflow. - BEHAVIOR
overflow_x&scroll_xare 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_drawmethod 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::Imagean error would occur. - Fixed bug where overflow on a
Binwas not calculated correctly withcalc_vert_overflowmethod. PostUpdateadded fieldunbound_mm_xfor min/max of horizontal content before bound (overflow removal).Binnow hascalc_hori_overflowmethod.- Fixed bug where alternative
Atlasformats weren't actually supported. - Fixed bug where atlas formats were not checked for
transfer_srcsupport. - Fixed bug where
OnOffButtonwould never drop. atlas::Imagenow hasto_8b_srgba&to_8b_lrgbamethods.
0.15.0
- BREAKING Update dependency
vulkano&vulkano-shadersto0.29. - BREAKING
Basalt::swap_caps()has been replaced byBasalt::surface_capabilities,Basalt::surface_formats, &Basalt::surface_present_modes. - BREAKING
Basalt::current_extent()now takesFullScreenExclusiveas an argument. - BREAKING Renamed
QwerytoQwerty... - BREAKING
BinColor::as_tuple()has been removed and replaced byBinColor::as_array(). - BREAKING
atlas::Coordsmethodstop_left,top_right,bottom_left, &bottom_rightnow return[f32; 2]instead of(f32, f32). - BEHAVIOR
Camera::mouse_inside()will now return false forBin's that havepass_eventsset 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
ilmeniteto0.7.0. - BREAKING Update dependency
vulkano&vulkano-shadersto0.26. - BREAKING Atlas has been reworked
- BREAKING Renamed method
default_samplertolinear_sampler. - Now uses 16 bit Linear formats for images instead of 8 bit SRGB.
- Added method
nearest_samplerthat provides a nearest filter sampler. - Methods
load_image_from_bytes,load_image_from_path, &load_image_from_urlnow 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 imagesImtforImtImageView.BstforBstImageView.
ImageType- BREAKING No longer has
Glyphvarient. UseSMono. - BREAKING Added
Rawvarient that is used forImage's constructed fromfrom_bst&from_imt.
- BREAKING No longer has
Image- Now implements
DebugandClone. - New constructors
from_bstfor construction fromBstImageView.from_imtfor construction fromImtImageView.
- BREAKING
to_srgbahas been renamed toto_16b_srgbawhich convertsImageto one constructed ofImageType::SRGBA&ImageData::D16. This does not effectImage's ofImageType::Raw. - BREAKING
to_lrgbahas been renamed toto_16b_lrgbawhich convertsImageto 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::interaceintointerface. - BREAKING
ItfRendereris no longer public. Its public facing functionality is now moved toInterfaceviadraw.- Draw method now takes a command buffer builder and a
ItfDrawTarget.ItfDrawTargetreplaces 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::Imageonly 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.
ItfDrawTargetalso hasSwapchainWithSourcewhich 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
BstImageViewtemporary views have been reworked.- BREAKING
create_tmpno longer returns anAtomicBool. - Added method
temporary_viewsto fetch the amount of temporary views. - Added method
mark_staleto 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_staleto 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
Optionsno longer hasinterface_limit_draw. Limiting the draw had weird quirks and is removed for the time being. - BREAKING
input::Event::WindowScalenow expects scale to be provided. - BREAKING
BstMSAALevelhas been moved into theinterfacemod. - BREAKING
BstEvent::BstItfEv&BstItfEvare 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. Interfacenow 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
Optionsnow hasimt_gpu_acceleratedto select whether ilmenite will use gpu accerated font rasterization.imt_fill_qualityto select the fill quality for ilmenite, andimt_sample_qualityto 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.