Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
SamplerStateCollection.cs
Go to the documentation of this file.
1using System;
2
4
5public sealed class SamplerStateCollection
6{
8
10
11 private int samplerOffset;
12
13 public SamplerState this[int index]
14 {
15 get
16 {
17 if (index >= 0)
18 {
20 if (index < (nint)array.LongLength)
21 {
22 return array[index];
23 }
24 }
25 throw new ArgumentOutOfRangeException("index");
26 }
27 set
28 {
29 if (index >= 0)
30 {
32 if (index < (nint)array.LongLength)
33 {
34 if (value == null)
35 {
37 }
38 if (value != array[index])
39 {
42 }
43 return;
44 }
45 }
46 throw new ArgumentOutOfRangeException("index");
47 }
48 }
49
50 internal SamplerStateCollection(GraphicsDevice pParent, int samplerOffset, int maxSamplers)
51 {
52 pDevice = pParent;
53 this.samplerOffset = samplerOffset;
54 base._002Ector();
55 pSamplerList = new SamplerState[maxSamplers];
56 }
57
58 internal void InitializeDeviceState()
59 {
60 int num = 0;
62 if (0 >= (nint)array.LongLength)
63 {
64 return;
65 }
66 while (true)
67 {
68 array[num] = null;
70 if (num < 0)
71 {
72 break;
73 }
75 if (num >= (nint)array.LongLength)
76 {
77 break;
78 }
79 if (linearWrap != null)
80 {
81 if (linearWrap != array[num])
82 {
83 linearWrap.Apply(pDevice, samplerOffset + num);
84 pSamplerList[num] = linearWrap;
85 }
86 num++;
88 if (num >= (nint)array.LongLength)
89 {
90 return;
91 }
92 continue;
93 }
95 }
96 throw new ArgumentOutOfRangeException("index");
97 }
98
99 internal void ClearState(int index)
100 {
101 if (index >= 0)
102 {
104 if (index < (nint)array.LongLength)
105 {
106 array[index] = null;
107 }
108 }
109 }
110}
SamplerStateCollection(GraphicsDevice pParent, int samplerOffset, int maxSamplers)
unsafe void Apply(GraphicsDevice device, int samplerIndex)
static readonly SamplerState LinearWrap