The one-stop SDK for RGB-peripherals
IMPORTANT NOTE
This is a library to integrate RGB-devices into your own application. It does not contain any executables!
If you're looking for a full blown software solution to manage your RGB-devices, take a look at Artemis.
RGBSurface
.RGBSurface surface = new RGBSurface();
CorsairDeviceProvider.Instance.Initialize(throwExceptions: true);
surface.Attach(CorsairDeviceProvider.Instance.Devices);
The Initialize
-method allows to load only devices of specific types by setting a filter and for debugging purposes allows to enable exception throwing. (By default they are catched and provided through the Exception
-event.)
You can also use the Load
-Extension on the surface.
surface.Load(CorsairDeviceProvider.Instance);
While most device-providers are implemented in a way that supports fast loading like this some may have a different loading procedures. (For example the
WS281XDeviceProvider
requires device-definitions before loading.)
surface.RegisterUpdateTrigger(new TimerUpdateTrigger());
If you want to trigger updates manually the
ManualUpdateTrigger
should be used.
surface.AlignDevices();
The basic setup is now complete and you can start setting up your rendering.
As an example we'll add a moving rainbow over all devices on the surface.
ILedGroup allLeds = new ListLedGroup(surface, surface.Leds);
RainbowGradient rainbow = new RainbowGradient();
rainbow.AddDecorator(new MoveGradientDecorator(surface));
ITexture texture = new ConicalGradientTexture(new Size(10, 10), rainbow);
allLeds.Brush = new TextureBrush(texture);
RGBSurface surface = new RGBSurface();
surface.Load(CorsairDeviceProvider.Instance);
surface.AlignDevices();
surface.RegisterUpdateTrigger(new TimerUpdateTrigger());
ILedGroup allLeds = new ListLedGroup(surface, surface.Leds);
RainbowGradient rainbow = new RainbowGradient();
rainbow.AddDecorator(new MoveGradientDecorator(surface));
ITexture texture = new ConicalGradientTexture(new Size(10, 10), rainbow);
allLeds.Brush = new TextureBrush(texture);