Struct basalt::BstOptions

source ·
pub struct BstOptions { /* private fields */ }
Expand description

Options for Basalt’s creation and operation.

Implementations§

source§

impl BstOptions

source

pub fn app_loop(self) -> Self

Configure Basalt to run in app mode. The swapchain will be managed by Basalt and all renderering to the swapchain will be done by Basalt. Additional rendering to the swapchain will be unavailable. This is useful for applications that are UI only.

source

pub fn use_exclusive_fullscreen(self, to: bool) -> Self

Enables the device extension required for exclusive fullscreen. Generally this extension is only present on Windows. Basalt will return an error upon creation if this feature isn’t supported. With this option enabled BasaltWindow::enable_fullscreen() will use exclusive fullscreen; otherwise, borderless window will be used.

Default: false

Notes
  • Basalt will return an Err if the extension is not present.
source

pub fn ignore_dpi(self, to: bool) -> Self

Ignore dpi hints provided by the platform.

Default: false

source

pub fn window_size(self, width: u32, height: u32) -> Self

Set the inner size of the window to be created

Default: 1920, 1080

source

pub fn title<T: AsRef<str>>(self, title: T) -> Self

Set the title of the window to be created

Default: "Basalt"

source

pub fn scale(self, to: f32) -> Self

Set the initial scale of the UI

Default: 1.0

Notes
  • This is independant of DPI Scaling.
source

pub fn msaa(self, to: BstMSAALevel) -> Self

Set the the amount of MSAA of the UI

Default: BstMSAALevel::Four

source

pub fn prefer_integrated_gpu(self) -> Self

Prefer integrated graphics if they are available

source

pub fn instance_ext_union(self, ext: &InstanceExtensions) -> Self

Add additional instance extensions

source

pub fn device_ext_union(self, ext: &DeviceExtensions) -> Self

Add additional device extensions

source

pub fn with_features(self, features: VkFeatures) -> Self

Specifify a custom set of vulkan features. This should be used with basalt_required_vk_features() to ensure Basalt functions correctly. For example:

.with_features(
    Features {
        storage_buffer16_bit_access: true,
        .. basalt_required_vk_features()
    }
)

Default: basalt_required_vk_features()

source

pub fn composite_alpha(self, to: CompositeAlpha) -> Self

Set the composite alpha mode used when creating the swapchain. Only effective when using app loop.

Default: CompositeAlpha::Opaque

source

pub fn force_unix_backend_x11(self, to: bool) -> Self

Setting this to true, will set the environment variable WINIT_UNIX_BACKEND=x11 forcing winit to use x11 over wayland. It is recommended to set this to true if you intend to use Basalt::capture_cursor(). With winit on wayland, MouseMotion will not be emitted.

Default: false

source

pub fn imt_gpu_accelerated(self, to: bool) -> Self

Basalt uses ilmenite in the backend for text. Setting this option to true will allow ilmenite to use a gpu code path which will have some performance gain; however, this code path may be broken on some systems.

Default: true

source

pub fn imt_fill_quality(self, q: ImtFillQuality) -> Self

Basalt uses ilmenite in the backend for text. This option allows for modifying the fill quality (the amount of casted rays) that ilmenite will use.

Default: ImtFillQuality::Normal

source

pub fn imt_sample_quality(self, q: ImtSampleQuality) -> Self

Basalt uses ilmenite in the backend for text. This option allows for modifying the sample quality (the amount of samples in a subpixel) that ilmenite will use.

Default:: ImtSampleQuality::Normal

source

pub fn bin_parallel_threads(self, bin_parallel_threads: usize) -> Self

Specify how many threads to use for parallel Bin updates.

Default: 1/3 of available threads (rounded up)

source

pub fn conservative_draw(self, enable: bool) -> Self

Only update interface image on UI/Surface change.

Default: false

Notes:
  • This is for application mode applications only. See app_loop().
  • This feature is EXPERIMENTAL and may not always work correctly.

Trait Implementations§

source§

impl Clone for BstOptions

source§

fn clone(&self) -> BstOptions

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for BstOptions

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for BstOptions

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<R, P> ReadPrimitive<R> for Pwhere R: Read + ReadEndian<P>, P: Default,

source§

fn read_from_little_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian().
source§

fn read_from_big_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().
source§

fn read_from_native_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.