Table of Contents

Struct Sdl.Builder

Namespace
Sdl3Sharp
Assembly
Sdl3Sharp.dll

A builder that lets you perfom some preliminaries right before SDL gets initialized

public readonly ref struct Sdl.Builder
Inherited Members
Extension Methods

Methods

DontInitializeSubSystems(SubSystems)

Sets certain sub systems to be not initialized with SDL

public Sdl.Builder DontInitializeSubSystems(SubSystems subSystems)

Parameters

subSystems SubSystems

Sub systems to be not initialized with SDL

Returns

Sdl.Builder

The current Sdl.Builder so that additional calls can be chained

Remarks

NOTE: This does not prevent depend sub system from being initialized (e.g. Events when Audio should be initialized)

Exceptions

InvalidOperationException

The Sdl.Builder is used outside of the initialization process of a Sdl instance

InitializeSubSystems(SubSystems)

Sets certain sub systems to be initialized with SDL

public Sdl.Builder InitializeSubSystems(SubSystems subSystems)

Parameters

subSystems SubSystems

Sub systems to be initialized with SDL

Returns

Sdl.Builder

The current Sdl.Builder so that additional calls can be chained

Exceptions

InvalidOperationException

The Sdl.Builder is used outside of the initialization process of a Sdl instance

TrySetMetadata(string, string?)

Tries to set metadata about your app

public bool TrySetMetadata(string name, string? value)

Parameters

name string

The name of the metadata

value string

The value of the metadata, or null to remove that metadata

Returns

bool

true if the value of the metadata was successfully set; otherwise, false (check TryGet(out string?) for more information)

Remarks

You can optionally provide metadata about your app to SDL. This is not required, but strongly encouraged.

There are several locations where SDL can make use of metadata (an "About" box in the macOS menu bar, the name of the app can be shown on some audio mixers, etc). Any piece of metadata can be left out, if a specific detail doesn't make sense for the app.

See Sdl.Metadata for a overview over the available metadata properties and their meanings.

Multiple calls to this method with the same name value are allowed, but various state might not change once it has been already set up.

Exceptions

InvalidOperationException

The Sdl.Builder is used outside of the initialization process of a Sdl instance

TrySetMetadata(string?, string?, string?)

Tries to set basic metadata about your app

public bool TrySetMetadata(string? appName, string? appVersion, string? appIdentifier)

Parameters

appName string

The name of the application ("My Game 2: Bad Guy's Revenge!")

appVersion string

The version of the application ("1.0.0beta5" or a git hash, or whatever makes sense)

appIdentifier string

A unique string in reverse-domain format that identifies this app ("com.example.mygame2")

Returns

bool

true if the value of the metadata values are successfully set; otherwise, false (check TryGet(out string?) for more information)

Remarks

You can optionally provide metadata about your app to SDL. This is not required, but strongly encouraged.

There are several locations where SDL can make use of metadata (an "About" box in the macOS menu bar, the name of the app can be shown on some audio mixers, etc). Any piece of metadata can be left out as a null value, if a specific detail doesn't make sense for the app.

Passing a null value removes any previous metadata.

Multiple calls to this method are allowed, but various state might not change once it has been already set up.

This is a simplified interface for the most important information. You can supply significantly more detailed metadata with TrySetMetadata(string, string?).

Exceptions

InvalidOperationException

The Sdl.Builder is used outside of the initialization process of a Sdl instance