Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
CorsairGenericDevice.cs
Go to the documentation of this file.
1
using
System
;
2
using
Microsoft.Xna.Framework
;
3
4
namespace
ReLogic.Peripherals.RGB.Corsair
;
5
6
internal
class
CorsairGenericDevice
:
RgbDevice
7
{
8
private
readonly
CorsairLedColor
[]
_ledColors
;
9
10
protected
CorsairGenericDevice
(
RgbDeviceType
deviceType,
Fragment
fragment,
CorsairLedPosition
[] ledPositions,
DeviceColorProfile
colorProfile)
11
: base(
RgbDeviceVendor
.Corsair, deviceType, fragment, colorProfile)
12
{
13
_ledColors
=
new
CorsairLedColor
[base.LedCount];
14
for
(
int
i = 0; i < ledPositions.Length; i++)
15
{
16
_ledColors
[i].
LedId
= ledPositions[i].
LedId
;
17
}
18
}
19
20
public
override
void
Present
()
21
{
22
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
23
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
24
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
25
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
26
//IL_0054: Unknown result type (might be due to invalid IL or missing references)
27
for
(
int
i = 0; i < base.LedCount; i++)
28
{
29
Vector4
processedLedColor =
GetProcessedLedColor
(i);
30
_ledColors
[i].
R
= (int)(processedLedColor.
X
* 255f);
31
_ledColors
[i].
G
= (int)(processedLedColor.
Y
* 255f);
32
_ledColors
[i].
B
= (int)(processedLedColor.
Z
* 255f);
33
}
34
if
(
_ledColors
.Length != 0)
35
{
36
NativeMethods
.
CorsairSetLedsColorsAsync
(
_ledColors
.Length,
_ledColors
,
IntPtr
.
Zero
,
IntPtr
.
Zero
);
37
}
38
}
39
}
ReLogic.Peripherals.RGB.Corsair.CorsairGenericDevice._ledColors
readonly CorsairLedColor[] _ledColors
Definition
CorsairGenericDevice.cs:8
ReLogic.Peripherals.RGB.Corsair.CorsairGenericDevice.Present
override void Present()
Definition
CorsairGenericDevice.cs:20
ReLogic.Peripherals.RGB.Corsair.CorsairGenericDevice.CorsairGenericDevice
CorsairGenericDevice(RgbDeviceType deviceType, Fragment fragment, CorsairLedPosition[] ledPositions, DeviceColorProfile colorProfile)
Definition
CorsairGenericDevice.cs:10
ReLogic.Peripherals.RGB.Corsair.CorsairGenericDevice
Definition
CorsairGenericDevice.cs:7
ReLogic.Peripherals.RGB.Corsair.NativeMethods.CorsairSetLedsColorsAsync
static bool CorsairSetLedsColorsAsync(int size, [In][Out] CorsairLedColor[] ledsColors, IntPtr callback, IntPtr context)
ReLogic.Peripherals.RGB.Corsair.NativeMethods
Definition
NativeMethods.cs:7
ReLogic.Peripherals.RGB.DeviceColorProfile
Definition
DeviceColorProfile.cs:7
ReLogic.Peripherals.RGB.Fragment
Definition
Fragment.cs:7
ReLogic.Peripherals.RGB.RgbDevice.GetProcessedLedColor
Vector4 GetProcessedLedColor(int index)
Definition
RgbDevice.cs:37
ReLogic.Peripherals.RGB.RgbDevice
Definition
RgbDevice.cs:7
Microsoft.Xna.Framework
Definition
AlphaTestEffect.cs:1
ReLogic.Peripherals.RGB.Corsair
Definition
CorsairAccessMode.cs:1
ReLogic.Peripherals.RGB.RgbDeviceVendor
RgbDeviceVendor
Definition
RgbDeviceVendor.cs:4
ReLogic.Peripherals.RGB.RgbDeviceType
RgbDeviceType
Definition
RgbDeviceType.cs:4
System
Definition
BlockingCollection.cs:8
Microsoft.Xna.Framework.Vector4.Z
float Z
Definition
Vector4.cs:20
Microsoft.Xna.Framework.Vector4.Y
float Y
Definition
Vector4.cs:17
Microsoft.Xna.Framework.Vector4.X
float X
Definition
Vector4.cs:14
Microsoft.Xna.Framework.Vector4
Definition
Vector4.cs:12
ReLogic.Peripherals.RGB.Corsair.CorsairLedColor.R
int R
Definition
CorsairLedColor.cs:7
ReLogic.Peripherals.RGB.Corsair.CorsairLedColor.G
int G
Definition
CorsairLedColor.cs:9
ReLogic.Peripherals.RGB.Corsair.CorsairLedColor.LedId
CorsairLedId LedId
Definition
CorsairLedColor.cs:5
ReLogic.Peripherals.RGB.Corsair.CorsairLedColor.B
int B
Definition
CorsairLedColor.cs:11
ReLogic.Peripherals.RGB.Corsair.CorsairLedColor
Definition
CorsairLedColor.cs:4
ReLogic.Peripherals.RGB.Corsair.CorsairLedPosition.LedId
CorsairLedId LedId
Definition
CorsairLedPosition.cs:8
ReLogic.Peripherals.RGB.Corsair.CorsairLedPosition
Definition
CorsairLedPosition.cs:7
System.IntPtr.Zero
static readonly IntPtr Zero
Definition
IntPtr.cs:18
System.IntPtr
Definition
IntPtr.cs:14
source
ReLogic
ReLogic.Peripherals.RGB.Corsair
CorsairGenericDevice.cs
Generated by
1.10.0