Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ SetVertexDeclaration() [1/2]

unsafe void Microsoft.Xna.Framework.Graphics.DeclarationManager.SetVertexDeclaration ( VertexBufferBinding * vertexBuffers,
int count )
inlinepackage

Definition at line 105 of file DeclarationManager.cs.

106 {
107 int num = (int)stackalloc byte[_003CModule_003E.__CxxQueryExceptionSize()];
108 bool lockTaken = false;
109 try
110 {
111 Monitor.Enter(this, ref lockTaken);
112 bool flag = false;
113 for (int i = 0; i < count; i++)
114 {
115 VertexDeclaration vertexDeclaration = ((VertexBufferBinding*)(System.Runtime.CompilerServices.Unsafe.SizeOf<VertexBufferBinding>() * i + (byte*)vertexBuffers))->_vertexBuffer._vertexDeclaration;
116 DeclarationBinding binding = vertexDeclaration._binding;
118 {
119 if (binding == null || vertexDeclaration.GraphicsDevice != device)
120 {
122 binding = vertexDeclaration._binding;
123 }
125 flag = true;
126 }
127 }
128 for (int j = count; j < currentDeclarationCount; j++)
129 {
130 currentDeclarations[j] = null;
131 flag = true;
132 }
134 if (flag)
135 {
137 }
138 }
139 catch when (((Func<bool>)delegate
140 {
141 // Could not convert BlockContainer to single expression
143 return (byte)_003CModule_003E.__CxxExceptionFilter((void*)Marshal.GetExceptionPointers(), null, 0, null) != 0;
144 }).Invoke())
145 {
146 uint num2 = 0u;
147 _003CModule_003E.__CxxRegisterExceptionObject((void*)Marshal.GetExceptionPointers(), (void*)num);
148 try
149 {
150 try
151 {
152 ClearCurrent();
153 _003CModule_003E._CxxThrowException(null, null);
154 return;
155 }
156 catch when (((Func<bool>)delegate
157 {
158 // Could not convert BlockContainer to single expression
159 num2 = (uint)_003CModule_003E.__CxxDetectRethrow((void*)Marshal.GetExceptionPointers());
160 return (byte)num2 != 0;
161 }).Invoke())
162 {
163 }
164 if (num2 != 0)
165 {
166 throw;
167 }
168 }
169 finally
170 {
171 _003CModule_003E.__CxxUnregisterExceptionObject((void*)num, (int)num2);
172 }
173 }
174 finally
175 {
176 if (lockTaken)
177 {
178 Monitor.Exit(this);
179 }
180 }
181 }
static void Exit(object obj)
static void Enter(object obj)

References Microsoft.Xna.Framework.Graphics.DeclarationManager.ClearCurrent(), System.count, Microsoft.Xna.Framework.Graphics.DeclarationManager.currentDeclarationCount, Microsoft.Xna.Framework.Graphics.DeclarationManager.currentDeclarations, Microsoft.Xna.Framework.Graphics.DeclarationManager.device, System.Threading.Monitor.Enter(), System.Threading.Monitor.Exit(), System.Runtime.InteropServices.Marshal.GetExceptionCode(), System.Runtime.InteropServices.Marshal.GetExceptionPointers(), and Microsoft.Xna.Framework.Graphics.DeclarationManager.SetNativeDeclaration().

Referenced by Microsoft.Xna.Framework.Graphics.GraphicsDevice.BeginUserPrimitives(), and Microsoft.Xna.Framework.Graphics.GraphicsDevice.SetVertexBuffers().