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

◆ OcclusionQuery() [2/2]

unsafe Microsoft.Xna.Framework.Graphics.OcclusionQuery.OcclusionQuery ( GraphicsDevice graphicsDevice)
inline

Definition at line 77 of file OcclusionQuery.cs.

78 {
79 try
80 {
81 if (graphicsDevice == null)
82 {
83 throw new ArgumentNullException("graphicsDevice", FrameworkResources.DeviceCannotBeNullOnResourceCreate);
84 }
85 if (!graphicsDevice._profileCapabilities.OcclusionQuery)
86 {
87 graphicsDevice._profileCapabilities.ThrowNotSupportedException(FrameworkResources.ProfileFeatureNotSupported, typeof(OcclusionQuery).Name);
88 }
90 fixed (IDirect3DQuery9** ptr = &pComPtr)
91 {
92 int num = *(int*)graphicsDevice.pComPtr + 472;
93 int num2 = ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, _D3DQUERYTYPE, IDirect3DQuery9**, int>)(int)(*(uint*)num))((nint)graphicsDevice.pComPtr, (_D3DQUERYTYPE)9, ptr);
94 if (num2 < 0)
95 {
96 throw GraphicsHelpers.GetExceptionFromResult((uint)num2);
97 }
98 _parent = graphicsDevice;
100 return;
101 }
102 }
103 catch
104 {
105 //try-fault
106 base.Dispose(true);
107 throw;
108 }
109 }
unsafe void AddTrackedObject(object managedObject, void *pComPtr, uint resourceManagementMode, ulong handle, ref ulong updatedHandle)
unsafe OcclusionQuery(IDirect3DQuery9 *pInterface, GraphicsDevice pDevice)

References Microsoft.Xna.Framework.Graphics.OcclusionQuery._hasIsCompleteBeenQueried, Microsoft.Xna.Framework.Graphics.GraphicsResource._internalHandle, Microsoft.Xna.Framework.Graphics.GraphicsResource._parent, Microsoft.Xna.Framework.Graphics.GraphicsDevice._profileCapabilities, Microsoft.Xna.Framework.Graphics.DeviceResourceManager.AddTrackedObject(), Microsoft.Xna.Framework.FrameworkResources.DeviceCannotBeNullOnResourceCreate, Microsoft.Xna.Framework.Graphics.GraphicsHelpers.GetExceptionFromResult(), Microsoft.Xna.Framework.Graphics.GraphicsResource.Name, Microsoft.Xna.Framework.Graphics.ProfileCapabilities.OcclusionQuery, Microsoft.Xna.Framework.Graphics.GraphicsDevice.pComPtr, Microsoft.Xna.Framework.Graphics.OcclusionQuery.pComPtr, Microsoft.Xna.Framework.FrameworkResources.ProfileFeatureNotSupported, Microsoft.Xna.Framework.Graphics.GraphicsDevice.Resources, and Microsoft.Xna.Framework.Graphics.ProfileCapabilities.ThrowNotSupportedException().