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
56 changes: 56 additions & 0 deletions RGB.NET.Sandbox/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
using System.Diagnostics;
using RGB.NET.Core;
using RGB.NET.Presets.Decorators;
using RGB.NET.Presets.Textures;
using RGB.NET.Presets.Textures.Gradients;

namespace RGB.NET.Sandbox;

internal class Program
{
public static void Main(string[] args)
{
long before = Stopwatch.GetTimestamp();

AbstractRGBDeviceProvider[] deviceProviders = [
Devices.Wooting.WootingDeviceProvider.Instance,
//Add more device providers here
];

RGBSurface surface = new();
TimerUpdateTrigger timer = new() { UpdateFrequency = 1d / 60 };

surface.RegisterUpdateTrigger(timer);

surface.Exception += a => { Console.WriteLine(a.Exception.Message); };

foreach (AbstractRGBDeviceProvider dp in deviceProviders)
{
dp.Exception += (a, b) => { Console.WriteLine(b.Exception.Message); };
dp.Initialize();
foreach (IRGBDevice device in dp.Devices)
{
Console.WriteLine(device.DeviceInfo.DeviceName);
}

surface.Attach(dp.Devices);
}

TimeSpan after = Stopwatch.GetElapsedTime(before);
Console.WriteLine($"Initialized in {after.TotalMilliseconds} ms");

ILedGroup group = new ListLedGroup(surface, surface.Leds);
IGradient gradient = new RainbowGradient();
gradient.AddDecorator(new MoveGradientDecorator(surface, 500));
group.Brush = new TextureBrush(new LinearGradientTexture(new Size(1, 1), gradient));

Console.ReadLine();

foreach (AbstractRGBDeviceProvider dp in deviceProviders)
{
dp.Dispose();
}

surface.Dispose();
}
}
33 changes: 33 additions & 0 deletions RGB.NET.Sandbox/RGB.NET.Sandbox.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\RGB.NET.Core\RGB.NET.Core.csproj" />
<ProjectReference Include="..\RGB.NET.Devices.Asus\RGB.NET.Devices.Asus.csproj" />
<ProjectReference Include="..\RGB.NET.Devices.CoolerMaster\RGB.NET.Devices.CoolerMaster.csproj" />
<ProjectReference Include="..\RGB.NET.Devices.Corsair\RGB.NET.Devices.Corsair.csproj" />
<ProjectReference Include="..\RGB.NET.Devices.Corsair_Legacy\RGB.NET.Devices.Corsair_Legacy.csproj" />
<ProjectReference Include="..\RGB.NET.Devices.Debug\RGB.NET.Devices.Debug.csproj" />
<ProjectReference Include="..\RGB.NET.Devices.DMX\RGB.NET.Devices.DMX.csproj" />
<ProjectReference Include="..\RGB.NET.Devices.Logitech\RGB.NET.Devices.Logitech.csproj" />
<ProjectReference Include="..\RGB.NET.Devices.Msi\RGB.NET.Devices.Msi.csproj" />
<ProjectReference Include="..\RGB.NET.Devices.Novation\RGB.NET.Devices.Novation.csproj" />
<ProjectReference Include="..\RGB.NET.Devices.OpenRGB\RGB.NET.Devices.OpenRGB.csproj" />
<ProjectReference Include="..\RGB.NET.Devices.PicoPi\RGB.NET.Devices.PicoPi.csproj" />
<ProjectReference Include="..\RGB.NET.Devices.Razer\RGB.NET.Devices.Razer.csproj" />
<ProjectReference Include="..\RGB.NET.Devices.SteelSeries\RGB.NET.Devices.SteelSeries.csproj" />
<ProjectReference Include="..\RGB.NET.Devices.WLED\RGB.NET.Devices.WLED.csproj" />
<ProjectReference Include="..\RGB.NET.Devices.Wooting\RGB.NET.Devices.Wooting.csproj" />
<ProjectReference Include="..\RGB.NET.Devices.WS281X\RGB.NET.Devices.WS281X.csproj" />
<ProjectReference Include="..\RGB.NET.Presets\RGB.NET.Presets.csproj" />
</ItemGroup>

<ItemGroup>
<Content Include="x64\**" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
</Project>
8 changes: 7 additions & 1 deletion RGB.NET.sln
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@


Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.1.32407.343
Expand Down Expand Up @@ -51,6 +51,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RGB.NET.Devices.Corsair_Leg
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RGB.NET.Devices.WLED", "RGB.NET.Devices.WLED\RGB.NET.Devices.WLED.csproj", "{C533C5EA-66A8-4826-A814-80791E7593ED}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RGB.NET.Sandbox", "RGB.NET.Sandbox\RGB.NET.Sandbox.csproj", "{BA099D3B-1B54-43D7-BCBE-18182CA91F28}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -145,6 +147,10 @@ Global
{C533C5EA-66A8-4826-A814-80791E7593ED}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C533C5EA-66A8-4826-A814-80791E7593ED}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C533C5EA-66A8-4826-A814-80791E7593ED}.Release|Any CPU.Build.0 = Release|Any CPU
{BA099D3B-1B54-43D7-BCBE-18182CA91F28}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BA099D3B-1B54-43D7-BCBE-18182CA91F28}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BA099D3B-1B54-43D7-BCBE-18182CA91F28}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BA099D3B-1B54-43D7-BCBE-18182CA91F28}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Loading