Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ jobs:
name: Unit Tests & Coverage
strategy:
matrix:
os: [ubuntu-22.04, windows-latest, macos-latest]
os: [ubuntu-24.04, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

- name: Setup .NET 9
- name: Setup .NET 10
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
dotnet-version: '10.0.x'

# --- SDL3 installation (Linux) ---
- name: Install build dependencies (Linux)
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
$dll = Get-ChildItem "$env:TEMP\sdl3" -Recurse -Filter "SDL3.dll" | Select-Object -First 1
if (-not $dll) { throw "SDL3.dll not found in extracted archive" }
Write-Host "Found SDL3.dll at: $($dll.FullName)"
$testBin = "tests\SharpSDL3.Tests\bin\Release\net9.0"
$testBin = "tests\SharpSDL3.Tests\bin\Release\net10.0"
New-Item -ItemType Directory -Path $testBin -Force | Out-Null
Copy-Item $dll.FullName -Destination $testBin -Force

Expand All @@ -112,11 +112,11 @@ jobs:
--collect:"XPlat Code Coverage"

- name: Install ReportGenerator
if: matrix.os == 'ubuntu-22.04'
if: matrix.os == 'ubuntu-24.04'
run: dotnet tool install --global dotnet-reportgenerator-globaltool

- name: Generate coverage report
if: matrix.os == 'ubuntu-22.04'
if: matrix.os == 'ubuntu-24.04'
shell: bash
run: |
COV=$(find ./TestResults -name "coverage.cobertura.xml" -type f | head -1)
Expand All @@ -133,7 +133,7 @@ jobs:
fi

- name: Post coverage summary to job
if: matrix.os == 'ubuntu-22.04' && always()
if: matrix.os == 'ubuntu-24.04' && always()
shell: bash
run: |
if [ -f ./TestResults/CoverageReport/SummaryGithub.md ]; then
Expand All @@ -149,7 +149,7 @@ jobs:
./TestResults/**/*.trx

- name: Upload coverage report
if: matrix.os == 'ubuntu-22.04' && always()
if: matrix.os == 'ubuntu-24.04' && always()
uses: actions/upload-artifact@v4
with:
name: coverage-report
Expand All @@ -160,15 +160,15 @@ jobs:
package:
name: Build NuGet Package
needs: test
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v4

- name: Setup .NET 9
- name: Setup .NET 10
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
dotnet-version: '10.0.x'

- name: Restore
run: dotnet restore SDL3/SharpSDL3.csproj
Expand All @@ -191,15 +191,15 @@ jobs:

fuzz:
name: Fuzz Tests
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v4

- name: Setup .NET 9
- name: Setup .NET 10
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
dotnet-version: '10.0.x'

- name: Install build dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion SDL3/CallerOwnedStringMarshaller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static unsafe class CallerOwnedStringMarshaller {
/// </summary>
/// <returns>A managed string.</returns>
public static string ConvertToManaged(nint unmanaged) {
string? result = Marshal.PtrToStringUTF8(unmanaged);
var result = Marshal.PtrToStringUTF8(unmanaged);
return result ?? "";
}

Expand Down
87 changes: 74 additions & 13 deletions SDL3/Enums/Colorspace.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,78 @@
namespace SharpSDL3.Enums;

/// <summary>
/// Colorspace definitions.
/// </summary>
public enum Colorspace {
Unknown = 0,
Srgb = 301991328,
SrgbLinear = 301991168,
Hdr10 = 301999616,
Jpeg = 570426566,
Bt601Limited = 554703046,
Bt601Full = 571480262,
Bt709Limited = 554697761,
Bt709Full = 571474977,
Bt2020Limited = 554706441,
Bt2020Full = 571483657,
RgbDefault = 301991328,
YuvDefault = 570426566
/// <summary>
/// Unknown Colorspace
/// </summary>
Unknown = 0x0,

/// <summary>
/// sRGB is a gamma corrected colorspace, and the default colorspace for SDL rendering and 8-bit RGB surfaces
/// </summary>
Srgb = 0x120005A0,

/// <summary>
/// This is a linear colorspace and the default colorspace for floating point surfaces. On Windows this is the scRGB colorspace, and on Apple platforms this is kCGColorSpaceExtendedLinearSRGB for EDR content
/// </summary>

Check warning on line 19 in SDL3/Enums/Colorspace.cs

View workflow job for this annotation

GitHub Actions / Unit Tests & Coverage (windows-latest)

XML comment has badly formed XML -- 'Expected an end tag for element 'summary'.'

Check warning on line 19 in SDL3/Enums/Colorspace.cs

View workflow job for this annotation

GitHub Actions / Unit Tests & Coverage (macos-latest)

XML comment has badly formed XML -- 'Expected an end tag for element 'summary'.'

Check warning on line 19 in SDL3/Enums/Colorspace.cs

View workflow job for this annotation

GitHub Actions / Fuzz Tests

XML comment has badly formed XML -- 'Expected an end tag for element 'summary'.'

Check warning on line 19 in SDL3/Enums/Colorspace.cs

View workflow job for this annotation

GitHub Actions / Unit Tests & Coverage (ubuntu-24.04)

XML comment has badly formed XML -- 'Expected an end tag for element 'summary'.'

Check warning on line 19 in SDL3/Enums/Colorspace.cs

View workflow job for this annotation

GitHub Actions / Build NuGet Package

XML comment has badly formed XML -- 'Expected an end tag for element 'summary'.'
SrgbLinear = 0x12000500,

Check warning on line 20 in SDL3/Enums/Colorspace.cs

View workflow job for this annotation

GitHub Actions / Unit Tests & Coverage (windows-latest)

XML comment has badly formed XML -- 'End tag was not expected at this location.'

Check warning on line 20 in SDL3/Enums/Colorspace.cs

View workflow job for this annotation

GitHub Actions / Unit Tests & Coverage (macos-latest)

XML comment has badly formed XML -- 'End tag was not expected at this location.'

Check warning on line 20 in SDL3/Enums/Colorspace.cs

View workflow job for this annotation

GitHub Actions / Fuzz Tests

XML comment has badly formed XML -- 'End tag was not expected at this location.'

Check warning on line 20 in SDL3/Enums/Colorspace.cs

View workflow job for this annotation

GitHub Actions / Unit Tests & Coverage (ubuntu-24.04)

XML comment has badly formed XML -- 'End tag was not expected at this location.'

Check warning on line 20 in SDL3/Enums/Colorspace.cs

View workflow job for this annotation

GitHub Actions / Build NuGet Package

XML comment has badly formed XML -- 'End tag was not expected at this location.'
Comment thread
Blizzardo1 marked this conversation as resolved.

/// <summary>
/// HDR10 is a non-linear HDR colorspace and the default colorspace for 10-bit surfaces
/// </summary>
Hdr10 = 0x12002600,

/// <summary>
/// JPEG/JFIF YUV colorspace. Full range BT.601 matrix, used by JPEG images and many web/consumer formats.
/// Chroma is not subsampled (4:4:4).
/// </summary>
Jpeg = 0x220004C6,

/// <summary>
/// BT.601 limited range YUV colorspace. Standard definition TV colorspace (NTSC/PAL).
/// Limited range means luma is clamped to [16–235] and chroma to [16–240].
/// </summary>
Bt601Limited = 0x211018C6,

/// <summary>
/// BT.601 full range YUV colorspace. Standard definition TV primaries with full [0–255] luma and chroma range.
/// Commonly used in MJPEG and some webcam outputs.
/// </summary>
Bt601Full = 0x221018C6,

/// <summary>
/// BT.709 limited range YUV colorspace. High definition TV standard (1080p/720p broadcast).
/// Limited range luma [16–235], the dominant format for HD video delivery and Blu-ray.
/// </summary>
Bt709Limited = 0x21100421,

/// <summary>
/// BT.709 full range YUV colorspace. HD primaries with full [0–255] range.
/// Less common than limited range; sometimes seen in PC-captured HD content.
/// </summary>
Bt709Full = 0x22100421,

/// <summary>
/// BT.2020 limited range YUV colorspace. Ultra HD / 4K broadcast standard with a much wider color gamut
/// than BT.709. Limited range; used in HDR10 and HLG HDR video delivery.
/// </summary>
Bt2020Limited = 0x21102609,

/// <summary>
/// BT.2020 full range YUV colorspace. Same wide-gamut UHD primaries as BT.2020 Limited
/// but with full [0–255] range. Uncommon in broadcast; occasionally seen in professional/camera workflows.
/// </summary>
Bt2020Full = 0x22102609,

/// <summary>
/// The default colorspace for RGB surfaces if no colorspace is specified
/// </summary>
RgbDefault = Srgb,

/// <summary>
/// The default colorspace for YUV surfaces if no colorspace is specified
/// </summary>
YuvDefault = Jpeg
}
Expand Down
Loading
Loading