Table of Contents

Interface IRenderingDriver

Namespace
Sdl3Sharp.Video.Rendering.Drivers
Assembly
Sdl3Sharp.dll

Represents a rendering driver used to specify the rendering backend in Renderer<TDriver> and Texture<TDriver>

public interface IRenderingDriver

Remarks

There are some pre-defined rendering drivers that SDL comes with. Not all of them are necessarily available in every environment. You can check the AvailableDriverNames property to see which rendering drivers are available in the current environment. The rendering drivers that SDL comes with are:

  • Direct3D11Direct3D 11 backend (only available on Windows)
  • Direct3D12Direct3D 12 backend (only available on Windows)
  • Direct3D9Direct3D 9 backend (only available on Windows)
  • MetalMetal backend (only available on macOS and iOS)
  • NGageNokia N-Gage backend (not supported; experimental only)
  • OpenGLOpenGL backend
  • OpenGLEs2OpenGL for Embedded Systems 2 backend (primarily only available on mobile and embedded platforms, but may be available on some desktop platforms as well)
  • PlayStation2Sony PlayStation 2 backend (not supported; experimental only)
  • PlayStationPortableSony PlayStation Portable backend (not supported; experimental only)
  • PlayStationVitaSony PlayStation Vita backend (not supported; experimental only)
  • VulkanVulkan backend
  • GpuGPU backend (only available on platforms that support the SDL GPU render API, which are primarly platforms that support either Vulkan, Metal, or Direct3D12 as well)
  • SoftwareSoftware rendering backend (supported almost everywhere; not hardware-accelerated; needed when rendering should be done to a Surface directly instead of to a Window or to an off-screen render target)

Please note that some of these rendering drivers require platforms that .NET doesn't run on (yet). These drivers are currently unsupported and marked as experimental (e.g. NGage, PlayStation2, PlayStationPortable, and PlayStationVita).

Properties

AvailableDriverNames

Gets the list of names of available rendering drivers in the current environment

public static ImmutableArray<string> AvailableDriverNames { get; }

Property Value

ImmutableArray<string>

The list of names of available rendering drivers in the current environment

Remarks

The list of available rendering drivers is only retrieved once and then cached afterwards, so the value of this property won't change during the lifetime of the application.

The list is in the order that rendering drivers are normally initialized by default; the drivers that seem more reasonable to choose first (as far as the SDL developers believe) are earlier in the list.

The names of all pre-defined rendering drivers are all simple, low-ASCII identifiers, like "opengl", "direct3d12" or "metal". These never have Unicode characters, and are not meant to be proper names.

You can use the value of the Name properties of individual rendering drivers types (e.g. Name) to check for the availability of a certain rendering driver; alternatively you can check the Sdl3Sharp.Video.Rendering.Drivers.RenderingDriverExtensions.get_IsAvailable<TDriver>() property for that.

Name

Gets the name of the rendering driver

public static abstract string? Name { get; }

Property Value

string

The name of the rendering driver, or null if the driver doesn't have a name (although all pre-defined rendering available to the user do have a non-null name)

Remarks

The names of all pre-defined rendering drivers are all simple, low-ASCII identifiers, like "opengl", "direct3d12" or "metal". These never have Unicode characters, and are not meant to be proper names.