-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Description
While Colore is great cause of the many Helper Methods (like SetCustom...) I think the base Methods of the SDK should be public and similar to the C++ implementation to not confuse people. This allows for easier porting of existing C++ or C# code to the other language.
It also allows more advantage use of storing and retriving frames with CreateEffect and SetEffect(guid).
That means:
- Create(Device)Effect should be made available to the public as a method under each Device and have a way to pass NULL as ref which seems to directly apply the effect after creation as seen in the Chroma Sample SDK App.
- SetEffect should accept a GUID instead of an Effect(Type).
- ... more(?)
Your thoughts about this?
Possible implementation 1. Guid passed as out as in the Chroma SDK.:
# Get GUID and Apply
var custom = Custom.Create();
custom.Set(Color.Red);
Guid guid;
Chroma.Instance.Keyboard.CreateEffect(Corale.Colore.Razer.Keyboard.Effects.Effect.Custom, custom, out guid);
if (guid != Guid.Empty) Chroma.Instance.Keyboard.SetEffect(guid);
# Apply directly
var custom2 = Custom.Create();
custom2.Set(Color.Blue);
Chroma.Instance.Keyboard.CreateEffect(Corale.Colore.Razer.Keyboard.Effects.Effect.Custom, custom2);Possible implementation 2. CreateEffect with additional parameter for applying instead of returning Guid:
# Get GUID and Apply
var custom = Custom.Create();
custom.Set(Color.Red);
var guid = Chroma.Instance.Keyboard.CreateEffect(Corale.Colore.Razer.Keyboard.Effects.Effect.Custom, custom);
if (guid != Guid.Empty) Chroma.Instance.Keyboard.SetEffect(guid);
# Apply directly
var custom2 = Custom.Create();
custom2.Set(Color.Blue);
Chroma.Instance.Keyboard.CreateEffect(Corale.Colore.Razer.Keyboard.Effects.Effect.Custom, custom2, true);