mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 19:36:28 +00:00
Added a layer of abstraction between RGB.NET and Artemis
This means Artemis can add extra functionality It also avoid having to reference RGB.NET for basic rendering Implemented rendering scaling
This commit is contained in:
1 parent
498b6a6111
commit
8777e8975f
41 files changed
+725
-494
No files matched your search
@@ -0,0 +1,20 @@
|
||||
using RGB.NET.Core;
|
||||
|
||||
namespace Artemis.Core.Extensions
|
||||
{
|
||||
public static class RgbDeviceExtensions
|
||||
{
|
||||
public static int GetDeviceHashCode(this IRGBDevice rgbDevice)
|
||||
{
|
||||
unchecked
|
||||
{
|
||||
var hashCode = rgbDevice.DeviceInfo.DeviceName?.GetHashCode() ?? 0;
|
||||
hashCode = (hashCode * 397) ^ (rgbDevice.DeviceInfo.Manufacturer?.GetHashCode() ?? 0);
|
||||
hashCode = (hashCode * 397) ^ (rgbDevice.DeviceInfo.Model?.GetHashCode() ?? 0);
|
||||
hashCode = (hashCode * 397) ^ (int) rgbDevice.DeviceInfo.DeviceType;
|
||||
hashCode = (hashCode * 397) ^ (int) rgbDevice.DeviceInfo.Lighting;
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user