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

◆ Apply()

unsafe void Microsoft.Xna.Framework.Graphics.DepthStencilState.Apply ( GraphicsDevice device)
inlinepackage

Definition at line 361 of file DepthStencilState.cs.

362 {
363 if (isDisposed)
364 {
366 }
367 if (_parent != device)
368 {
369 _parent = device;
370 isBound = true;
371 d3dDepthBufferFunction = _003CModule_003E.ConvertXnaComparisonToDx(cachedDepthBufferFunction);
372 d3dStencilFunction = _003CModule_003E.ConvertXnaComparisonToDx(cachedStencilFunction);
373 d3dStencilPass = _003CModule_003E.ConvertXnaStencilToDx(cachedStencilPass);
374 d3dStencilFail = _003CModule_003E.ConvertXnaStencilToDx(cachedStencilFail);
375 d3dStencilDepthBufferFail = _003CModule_003E.ConvertXnaStencilToDx(cachedStencilDepthBufferFail);
376 d3dCounterClockwiseStencilFunction = _003CModule_003E.ConvertXnaComparisonToDx(cachedCounterClockwiseStencilFunction);
377 d3dCounterClockwiseStencilPass = _003CModule_003E.ConvertXnaStencilToDx(cachedCounterClockwiseStencilPass);
378 d3dCounterClockwiseStencilFail = _003CModule_003E.ConvertXnaStencilToDx(cachedCounterClockwiseStencilFail);
380 }
381 IntPtr pComPtr = (IntPtr)device.pComPtr;
382 Helpers.CheckDisposed(device, pComPtr);
383 IDirect3DDevice9* pComPtr2 = device.pComPtr;
384 ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, _D3DRENDERSTATETYPE, uint, int>)(int)(*(uint*)(*(int*)pComPtr2 + 228)))((nint)pComPtr2, (_D3DRENDERSTATETYPE)7, cachedDepthBufferEnable ? 1u : 0u);
385 ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, _D3DRENDERSTATETYPE, uint, int>)(int)(*(uint*)(*(int*)pComPtr2 + 228)))((nint)pComPtr2, (_D3DRENDERSTATETYPE)14, cachedDepthBufferWriteEnable ? 1u : 0u);
386 ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, _D3DRENDERSTATETYPE, uint, int>)(int)(*(uint*)(*(int*)pComPtr2 + 228)))((nint)pComPtr2, (_D3DRENDERSTATETYPE)23, (uint)d3dDepthBufferFunction);
387 ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, _D3DRENDERSTATETYPE, uint, int>)(int)(*(uint*)(*(int*)pComPtr2 + 228)))((nint)pComPtr2, (_D3DRENDERSTATETYPE)52, cachedStencilEnable ? 1u : 0u);
389 {
390 ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, _D3DRENDERSTATETYPE, uint, int>)(int)(*(uint*)(*(int*)pComPtr2 + 228)))((nint)pComPtr2, (_D3DRENDERSTATETYPE)56, (uint)d3dStencilFunction);
391 ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, _D3DRENDERSTATETYPE, uint, int>)(int)(*(uint*)(*(int*)pComPtr2 + 228)))((nint)pComPtr2, (_D3DRENDERSTATETYPE)55, (uint)d3dStencilPass);
392 ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, _D3DRENDERSTATETYPE, uint, int>)(int)(*(uint*)(*(int*)pComPtr2 + 228)))((nint)pComPtr2, (_D3DRENDERSTATETYPE)53, (uint)d3dStencilFail);
393 ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, _D3DRENDERSTATETYPE, uint, int>)(int)(*(uint*)(*(int*)pComPtr2 + 228)))((nint)pComPtr2, (_D3DRENDERSTATETYPE)54, (uint)d3dStencilDepthBufferFail);
394 ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, _D3DRENDERSTATETYPE, uint, int>)(int)(*(uint*)(*(int*)pComPtr2 + 228)))((nint)pComPtr2, (_D3DRENDERSTATETYPE)185, cachedTwoSidedStencilMode ? 1u : 0u);
396 {
397 ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, _D3DRENDERSTATETYPE, uint, int>)(int)(*(uint*)(*(int*)pComPtr2 + 228)))((nint)pComPtr2, (_D3DRENDERSTATETYPE)189, (uint)d3dCounterClockwiseStencilFunction);
398 ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, _D3DRENDERSTATETYPE, uint, int>)(int)(*(uint*)(*(int*)pComPtr2 + 228)))((nint)pComPtr2, (_D3DRENDERSTATETYPE)188, (uint)d3dCounterClockwiseStencilPass);
399 ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, _D3DRENDERSTATETYPE, uint, int>)(int)(*(uint*)(*(int*)pComPtr2 + 228)))((nint)pComPtr2, (_D3DRENDERSTATETYPE)186, (uint)d3dCounterClockwiseStencilFail);
400 ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, _D3DRENDERSTATETYPE, uint, int>)(int)(*(uint*)(*(int*)pComPtr2 + 228)))((nint)pComPtr2, (_D3DRENDERSTATETYPE)187, (uint)d3dCounterClockwiseStencilDepthBufferFail);
401 }
402 ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, _D3DRENDERSTATETYPE, uint, int>)(int)(*(uint*)(*(int*)pComPtr2 + 228)))((nint)pComPtr2, (_D3DRENDERSTATETYPE)58, (uint)cachedStencilMask);
403 ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, _D3DRENDERSTATETYPE, uint, int>)(int)(*(uint*)(*(int*)pComPtr2 + 228)))((nint)pComPtr2, (_D3DRENDERSTATETYPE)59, (uint)cachedStencilWriteMask);
404 ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, _D3DRENDERSTATETYPE, uint, int>)(int)(*(uint*)(*(int*)pComPtr2 + 228)))((nint)pComPtr2, (_D3DRENDERSTATETYPE)57, (uint)cachedReferenceStencil);
405 }
406 }

References Microsoft.Xna.Framework.Graphics.GraphicsResource._parent, Microsoft.Xna.Framework.Graphics.DepthStencilState.cachedCounterClockwiseStencilDepthBufferFail, Microsoft.Xna.Framework.Graphics.DepthStencilState.cachedCounterClockwiseStencilFail, Microsoft.Xna.Framework.Graphics.DepthStencilState.cachedCounterClockwiseStencilFunction, Microsoft.Xna.Framework.Graphics.DepthStencilState.cachedCounterClockwiseStencilPass, Microsoft.Xna.Framework.Graphics.DepthStencilState.cachedDepthBufferEnable, Microsoft.Xna.Framework.Graphics.DepthStencilState.cachedDepthBufferFunction, Microsoft.Xna.Framework.Graphics.DepthStencilState.cachedDepthBufferWriteEnable, Microsoft.Xna.Framework.Graphics.DepthStencilState.cachedReferenceStencil, Microsoft.Xna.Framework.Graphics.DepthStencilState.cachedStencilDepthBufferFail, Microsoft.Xna.Framework.Graphics.DepthStencilState.cachedStencilEnable, Microsoft.Xna.Framework.Graphics.DepthStencilState.cachedStencilFail, Microsoft.Xna.Framework.Graphics.DepthStencilState.cachedStencilFunction, Microsoft.Xna.Framework.Graphics.DepthStencilState.cachedStencilMask, Microsoft.Xna.Framework.Graphics.DepthStencilState.cachedStencilPass, Microsoft.Xna.Framework.Graphics.DepthStencilState.cachedStencilWriteMask, Microsoft.Xna.Framework.Graphics.DepthStencilState.cachedTwoSidedStencilMode, Microsoft.Xna.Framework.Helpers.CheckDisposed(), Microsoft.Xna.Framework.Graphics.DepthStencilState.d3dCounterClockwiseStencilDepthBufferFail, Microsoft.Xna.Framework.Graphics.DepthStencilState.d3dCounterClockwiseStencilFail, Microsoft.Xna.Framework.Graphics.DepthStencilState.d3dCounterClockwiseStencilFunction, Microsoft.Xna.Framework.Graphics.DepthStencilState.d3dCounterClockwiseStencilPass, Microsoft.Xna.Framework.Graphics.DepthStencilState.d3dDepthBufferFunction, Microsoft.Xna.Framework.Graphics.DepthStencilState.d3dStencilDepthBufferFail, Microsoft.Xna.Framework.Graphics.DepthStencilState.d3dStencilFail, Microsoft.Xna.Framework.Graphics.DepthStencilState.d3dStencilFunction, Microsoft.Xna.Framework.Graphics.DepthStencilState.d3dStencilPass, Microsoft.Xna.Framework.Graphics.DepthStencilState.isBound, Microsoft.Xna.Framework.Graphics.GraphicsResource.isDisposed, Microsoft.Xna.Framework.Graphics.GraphicsResource.Name, and Microsoft.Xna.Framework.Graphics.GraphicsDevice.pComPtr.