mirror of
https://github.com/DarthAffe/CUE.NET.git
synced 2025-12-12 16:58:29 +00:00
Updated test-project
This commit is contained in:
parent
9a9bf52fe9
commit
74973df040
@ -1,37 +0,0 @@
|
||||
using CUE.NET.Brushes;
|
||||
using CUE.NET.Effects;
|
||||
using CUE.NET.Gradients;
|
||||
|
||||
namespace SimpleDevTest
|
||||
{
|
||||
public class MoveRainbowEffect : AbstractBrushEffect<IGradientBrush>
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
public float DegreePerSecond { get; set; } = 30f;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
public override void Update(float deltaTime)
|
||||
{
|
||||
float value = DegreePerSecond * deltaTime;
|
||||
|
||||
//DarthAffe 11.09.2016: Only to test! This will overflow if run for a longer time!!!
|
||||
((RainbowGradient)Brush.Gradient).StartHue += value;
|
||||
((RainbowGradient)Brush.Gradient).EndHue += value;
|
||||
}
|
||||
|
||||
public override bool CanBeAppliedTo(IBrush target)
|
||||
{
|
||||
return (target as IGradientBrush)?.Gradient is RainbowGradient;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -36,15 +36,19 @@ namespace SimpleDevTest
|
||||
CueSDK.Initialize();
|
||||
Console.WriteLine("Initialized with " + CueSDK.LoadedArchitecture + "-SDK");
|
||||
|
||||
//CueSDK.KeyboardSDK.Brush = new LinearGradientBrush(new LinearGradient(true, new GradientStop(0, Color.Blue), new GradientStop(0.5f, Color.Red)));
|
||||
CueSDK.KeyboardSDK.Brush = new LinearGradientBrush(new RainbowGradient());
|
||||
CueSDK.KeyboardSDK.Brush.AddEffect(new MoveGradientEffect());
|
||||
|
||||
CueSDK.UpdateMode = UpdateMode.Continuous;
|
||||
|
||||
IBrush rainbowBrush = new LinearGradientBrush(new RainbowGradient());
|
||||
rainbowBrush.AddEffect(new FlashEffect { Attack = 5f, Sustain = 1f, Decay = 0, Release = 5f, Interval = 1f });
|
||||
rainbowBrush.AddEffect(new MoveRainbowEffect());
|
||||
rainbowBrush.AddEffect(new RemoveRedEffect());
|
||||
//IBrush rainbowBrush = new LinearGradientBrush(new RainbowGradient());
|
||||
//rainbowBrush.AddEffect(new FlashEffect { Attack = 5f, Sustain = 1f, Decay = 0, Release = 5f, Interval = 1f });
|
||||
//rainbowBrush.AddEffect(new MoveRainbowEffect());
|
||||
//rainbowBrush.AddEffect(new RemoveRedEffect());
|
||||
|
||||
foreach (ICueDevice device in CueSDK.InitializedDevices)
|
||||
AddTestBrush(device, rainbowBrush);
|
||||
//foreach (ICueDevice device in CueSDK.InitializedDevices)
|
||||
// AddTestBrush(device, rainbowBrush);
|
||||
|
||||
//// Get connected keyboard or throw exception if there is no light controllable keyboard connected
|
||||
//CorsairKeyboard keyboard = CueSDK.KeyboardSDK;
|
||||
|
||||
@ -47,7 +47,6 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="MoveRainbowEffect.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="RemoveRedEffect.cs" />
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user