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

◆ GraphicsDevice() [2/2]

Microsoft.Xna.Framework.Graphics.GraphicsDevice.GraphicsDevice ( GraphicsAdapter adapter,
GraphicsProfile graphicsProfile,
PresentationParameters presentationParameters )
inline

Definition at line 1133 of file GraphicsDevice.cs.

1134 {
1135 EmbeddedNativeType_003C_D3DCAPS9_003E embeddedNativeType_003C_D3DCAPS9_003E = new EmbeddedNativeType_003C_D3DCAPS9_003E();
1136 try
1137 {
1138 d3dCaps = embeddedNativeType_003C_D3DCAPS9_003E;
1139 base._002Ector();
1140 if (presentationParameters == null)
1141 {
1142 throw new ArgumentNullException("presentationParameters", FrameworkResources.NullNotAllowed);
1143 }
1144 if (adapter == null)
1145 {
1146 throw new ArgumentNullException("adapter", FrameworkResources.NullNotAllowed);
1147 }
1148 _deviceType = GraphicsAdapter.CurrentDeviceType;
1149 _graphicsProfile = graphicsProfile;
1150 _profileCapabilities = ProfileCapabilities.GetInstance(graphicsProfile);
1151 if (!adapter.IsProfileSupported(_deviceType, _graphicsProfile))
1152 {
1153 _profileCapabilities.ThrowNotSupportedException(FrameworkResources.ProfileInvalidDevice);
1154 }
1155 CreateDevice(adapter, presentationParameters);
1156 pCurrentAdapter = adapter;
1157 _DrawGuideHandler = null;
1158 pInternalCachedParams = presentationParameters.Clone();
1159 pPublicCachedParams = presentationParameters.Clone();
1162 GuideRendererConnector.GuideRendererType = typeof(GuideRenderer);
1163 return;
1164 }
1165 catch
1166 {
1167 //try-fault
1168 ((IDisposable)d3dCaps).Dispose();
1169 throw;
1170 }
1171 }
readonly EmbeddedNativeType_003C_D3DCAPS9_003E d3dCaps
unsafe void CreateDevice(GraphicsAdapter adapter, PresentationParameters presentationParameters)
static ProfileCapabilities GetInstance(GraphicsProfile graphicsProfile)

References Microsoft.Xna.Framework.Graphics.GraphicsDevice._deviceType, Microsoft.Xna.Framework.Graphics.GraphicsDevice._DrawGuideHandler, Microsoft.Xna.Framework.Graphics.GraphicsDevice._graphicsProfile, Microsoft.Xna.Framework.Graphics.GraphicsDevice._profileCapabilities, Microsoft.Xna.Framework.Graphics.PresentationParameters.Clone(), Microsoft.Xna.Framework.Graphics.GraphicsDevice.CreateDevice(), Microsoft.Xna.Framework.Graphics.GraphicsDevice.CreateHelperClasses(), Microsoft.Xna.Framework.Graphics.GraphicsAdapter.CurrentDeviceType, Microsoft.Xna.Framework.Graphics.GraphicsDevice.d3dCaps, Microsoft.Xna.Framework.Graphics.ProfileCapabilities.GetInstance(), Microsoft.Xna.Framework.Graphics.GraphicsDevice.InitializeDeviceState(), Microsoft.Xna.Framework.Graphics.GraphicsAdapter.IsProfileSupported(), Microsoft.Xna.Framework.FrameworkResources.NullNotAllowed, Microsoft.Xna.Framework.Graphics.GraphicsDevice.pCurrentAdapter, Microsoft.Xna.Framework.Graphics.GraphicsDevice.pInternalCachedParams, Microsoft.Xna.Framework.Graphics.GraphicsDevice.pPublicCachedParams, Microsoft.Xna.Framework.FrameworkResources.ProfileInvalidDevice, and Microsoft.Xna.Framework.Graphics.ProfileCapabilities.ThrowNotSupportedException().