Skip to content
Open
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ logs/
out/skm
out/lib/
tools/scripts/nuget-pkg/obj
tools/scripts/test/obj
tools/scripts/nuget-pkg/Libraries
tools/scripts/test/**/obj

### Debian packaging ###
tools/scripts/debian/libsplashkit-dev*
Expand Down
1 change: 0 additions & 1 deletion tools/scripts/nuget-pkg/SplashKit.cs

This file was deleted.

45 changes: 45 additions & 0 deletions tools/scripts/nuget-pkg/SplashKitSDK.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<!-- Project & package configuration -->
<PropertyGroup>
<TargetFrameworks>net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
<PlatformTarget>AnyCPU</PlatformTarget>
<RootNamespace>SplashKitSDK</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand All @@ -21,9 +23,52 @@
<PackageLicenseExpression>GPL-3.0-or-later</PackageLicenseExpression>
</PropertyGroup>

<!-- Debug-specific configuration -->
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DebugType>portable</DebugType>
</PropertyGroup>

<!-- Release-specific configuration -->
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DebugType>portable</DebugType>
</PropertyGroup>

<!-- Files to include -->
<ItemGroup>
<None Include="readme.md" Pack="true" PackagePath="/"/>
<None Include="icon.png" Pack="true" PackagePath="/"/>

<!-- C# bindings
SplashKit.cs was previously included as a symbolic link in this directory.
This was removed due to symlinks causing issues on MSYS2/Windows environments.
-->
<Compile Include="$(MSBuildThisFileDirectory)../../../generated/csharp/SplashKit.cs" Link="SplashKit.cs" />

<!-- Windows (x64) Libraries -->
<Content Include=".\Libraries\win64\*.dll">
<Pack>true</Pack>
<PackagePath>runtimes/win-x64/native</PackagePath>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PackageCopyToOutput>true</PackageCopyToOutput>
<Link>%(FileName)%(Extension)</Link>
</Content>

<!-- MacOS (Universal) Libraries -->
<Content Include=".\Libraries\macos\libSplashKit.dylib">
<Pack>true</Pack>
<PackagePath>runtimes/osx-x64/native</PackagePath>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PackageCopyToOutput>true</PackageCopyToOutput>
<Link>%(FileName)%(Extension)</Link>
</Content>

<Content Include=".\Libraries\macos\libSplashKit.dylib">
<Pack>true</Pack>
<PackagePath>runtimes/osx-arm64/native</PackagePath>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PackageCopyToOutput>true</PackageCopyToOutput>
<Link>%(FileName)%(Extension)</Link>
</Content>
</ItemGroup>

</Project>
33 changes: 2 additions & 31 deletions tools/scripts/nuget-pkg/download-libraries.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
#!/bin/bash

# See comments at end about adding libraries to NuGet package

# Set the GitHub repository URL
repo_url="https://github.com/splashkit/skm.git"

# Set the branch name
branch="master"

# Set the folders to download
# Note: SKM does not include pre-compiled libraries for Linux
folders=("lib/macos" "lib/win64")

# Create the destination directory if it doesn't exist
Expand All @@ -26,32 +25,4 @@ do

# Remove the temporary directory
rm -rf "${temp_dir}"
done

# TODO: Add the following comment lines to SplashKitSDK.csproj (with further testing)
# <PlatformTarget>AnyCPU</PlatformTarget>

# <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
# <DebugType>portable</DebugType>
# </PropertyGroup>

# <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
# <DebugType>portable</DebugType>
# </PropertyGroup>

# <ItemGroup>
# <Content Include=".\Libraries\win64\*.dll">
# <Pack>true</Pack>
# <PackagePath>lib\$(TargetFramework)</PackagePath>
# <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
# <PackageCopyToOutput>true</PackageCopyToOutput>
# <Link>%(FileName)%(Extension)</Link>
# </Content>
# <Content Include=".\Libraries\macos\libSplashKit.dylib">
# <Pack>true</Pack>
# <PackagePath>lib\$(TargetFramework)</PackagePath>
# <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
# <PackageCopyToOutput>true</PackageCopyToOutput>
# <Link>%(FileName)%(Extension)</Link>
# </Content>
# </ItemGroup>
done
9 changes: 9 additions & 0 deletions tools/scripts/test/Audio/Audio.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
115 changes: 115 additions & 0 deletions tools/scripts/test/Audio/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
using SplashKitSDK;
using static SplashKitSDK.SplashKit;

SetResourcesPath(GlobalSettings.ResourcePath);

Console.WriteLine("Starting Audio Tests...");

Console.WriteLine($" Audio should be ready? {AudioReady()}");

Console.WriteLine(" Closing audio...");
CloseAudio();

Console.WriteLine($" Audio should not be ready? {AudioReady()}");

Delay(500);

Console.WriteLine(" Opening audio...");
OpenAudio();

Console.WriteLine($" Is audio ready? {AudioReady()}");

Console.WriteLine($" Have not loaded a sound yet. Is a sound effect loaded? {HasSoundEffect("test")}");

SoundEffect s1 = LoadSoundEffect("test", "test.ogg");

Console.WriteLine($" Loaded sound effect. Is there a sound effect loaded? {HasSoundEffect("test")}");
Console.WriteLine(" Playing loaded sound effect");
PlaySoundEffect(s1, 1, 1.0f);

Delay(2000);

Console.WriteLine(" Downloading sound effect...");
DownloadSoundEffect("text message 2", "http://soundbible.com/grab.php?id=2155&type=wav", 80);
Console.WriteLine(" Playing downloaded sound effect twice");
PlaySoundEffect("text message 2", 2, 0.8);

Delay(5000);

Console.WriteLine(" Downloading music...");
DownloadMusic("music", "http://cdn.pixabay.com/download/audio/2025/10/29/audio_dcca153626.mp3?filename=classical-royal-british-music-427631.mp3", 80);
Console.WriteLine(" Playing downloaded music for 5 seconds");
PlayMusic("music");

Delay(5000);
StopMusic();

Console.WriteLine(" Playing named sound effect once at full volume");
PlaySoundEffect(SoundEffectNamed("test"), 1, 1.0f);

Delay(2000);

Console.WriteLine(" Playing sound effect twice");
PlaySoundEffect(SoundEffectNamed("test"), 2);

Delay(5000);

Console.WriteLine(" Playing sound effect");
PlaySoundEffect(SoundEffectNamed("test"), 1);
Delay(1000);
Console.WriteLine(" Stopping sound effect");
StopSoundEffect(SoundEffectNamed("test1"));

SoundEffect s2 = LoadSoundEffect("dancing", "dancingFrog.wav");
Console.WriteLine(" Fading out sound effect over 2 seconds");
PlaySoundEffect(s2);
FadeSoundEffectOut(s2, 2000);
Delay(3000);
Console.WriteLine(" Fading out all sound effects over 5 seconds");
PlaySoundEffect(s2);
FadeAllSoundEffectsOut(5000);

Delay(6000);

FreeSoundEffect(s1);

LoadSoundEffect("test2", "error.wav");
LoadSoundEffect("test3", "30248__streety__sword7.flac");

FreeAllSoundEffects();

LoadMusic("dance", "dancingFrog.wav");

Console.WriteLine(" Playing music...");
PlayMusic(MusicNamed("dance"), 1, 1.0f);

Delay(5000);

Console.WriteLine(" Pausing music...");
PauseMusic();

Delay(2000);

Console.WriteLine(" Resuming music...");
ResumeMusic();

Delay(5000);

Console.WriteLine(" Stopping music...");
StopMusic();

Delay(2000);
Console.WriteLine(" Fading in music over 2 secs...");
FadeMusicIn("dance", 2000);
Delay(5000);
Console.WriteLine(" Fading out music over 5 secs...");
FadeMusicOut(5000);
Delay(5000);

Console.WriteLine(" Closing audio...");
CloseAudio();

Console.WriteLine($" Is audio ready? {AudioReady()}");

Console.WriteLine("Audio Tests Ended");
Delay(5000);
12 changes: 12 additions & 0 deletions tools/scripts/test/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project>
<PropertyGroup>
<!-- Target frameworks should match those specified in the NuGet project: /tools/scripts/nuget-pkg/SplashKitSDK.csproj -->
<TargetFrameworks>net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
<!-- Suppress .NET and SplashKit version warnings -->
<NoWarn>NETSDK1138;NU1604</NoWarn>
</PropertyGroup>

<ItemGroup>
<Compile Include="../GlobalSettings.cs" Link="GlobalSettings.cs" />
</ItemGroup>
</Project>
6 changes: 6 additions & 0 deletions tools/scripts/test/Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Project>
<ItemGroup>
<!-- Update to match NuGet package version -->
<PackageReference Include="SplashKit" Version="1.3.1" />
</ItemGroup>
</Project>
7 changes: 7 additions & 0 deletions tools/scripts/test/GlobalSettings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
public static class GlobalSettings
{
// This path references resources used by the SplashKit Core integration test suite.
// By referencing the below field, NuGet test projects are able to share assets with the core tests.
// To utilise, put "SetResourcesPath(GlobalSettings.ResourcePath);" at the beginning of a test project
public static readonly string ResourcePath = "../../../../coresdk/src/test/Resources";
}
9 changes: 9 additions & 0 deletions tools/scripts/test/Graphics/Graphics.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
Loading