Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ChromaPipeline.cs
Go to the documentation of this file.
2using System.Linq;
3
5
6internal class ChromaPipeline
7{
8 public delegate void PostProcessingEvent(RgbDevice device, Fragment fragment, float time);
9
11
13
15 {
16 _hotkeys = keys;
17 }
18
20 {
21 foreach (RgbDevice device in devices)
22 {
23 ProcessDevice(device, shaders, time);
24 device.Present();
25 }
26 }
27
29 {
30 Fragment fragment = device.Rasterize();
31 if (shaders != null)
32 {
33 foreach (ShaderOperation shader in shaders)
34 {
35 shader.Process(device, fragment, time);
36 device.Render(fragment, shader.BlendState);
37 }
38 }
39 if (_hotkeys != null && device is RgbKeyboard rgbKeyboard)
40 {
41 rgbKeyboard.Render(_hotkeys.Where((RgbKey key) => key.IsVisible));
42 }
43 if (this.PostProcessingEvents != null)
44 {
46 this.PostProcessingEvents(device, fragment, time);
47 device.Render(fragment, new ShaderBlendState(BlendMode.PerPixelOpacity));
48 }
49 }
50}
void SetHotkeys(IEnumerable< RgbKey > keys)
void Process(IEnumerable< RgbDevice > devices, IEnumerable< ShaderOperation > shaders, float time)
void ProcessDevice(RgbDevice device, IEnumerable< ShaderOperation > shaders, float time)
delegate void PostProcessingEvent(RgbDevice device, Fragment fragment, float time)
virtual Fragment Rasterize()
Definition RgbDevice.cs:32
virtual void Render(Fragment fragment, ShaderBlendState blendState)
Definition RgbDevice.cs:83
readonly ShaderBlendState BlendState
void Process(RgbDevice device, Fragment fragment, float time)