Table of Contents

Class Sdl

Namespace
BSGameLib.Sdl3.Interop.Manual
Assembly
BSGameLib.Sdl3.Interop.dll

Helpers for calling SDL: turning its failure results into exceptions carrying SDL's error message.

public static class Sdl
Inheritance
Sdl
Inherited Members

Methods

Check(byte, string)

Throws if an SDL function that returns success as a bool reported failure (0), with SDL's error message and the calling member's name.

public static void Check(byte result, string caller = "")

Parameters

result byte
caller string

Exceptions

InvalidOperationException

result is 0.

Check<T>(T*, string)

Returns result, or throws if an SDL function that returns a pointer reported failure (null), with SDL's error message and the calling member's name.

public static T* Check<T>(T* result, string caller = "") where T : unmanaged

Parameters

result T*
caller string

Returns

T*

Type Parameters

T

Exceptions

InvalidOperationException

result is null.

GetError()

SDL's message for the last error on this thread, or null if there isn't one.

public static string GetError()

Returns

string