本文整理匯總了C#中Microsoft.Xna.Framework.PreparingDeviceSettingsEventArgs類的典型用法代碼示例。如果您正苦於以下問題:C# PreparingDeviceSettingsEventArgs類的具體用法?C# PreparingDeviceSettingsEventArgs怎麽用?C# PreparingDeviceSettingsEventArgs使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
PreparingDeviceSettingsEventArgs類屬於Microsoft.Xna.Framework命名空間,在下文中一共展示了PreparingDeviceSettingsEventArgs類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: graphics_PreparingDeviceSettings
void graphics_PreparingDeviceSettings(object sender,
PreparingDeviceSettingsEventArgs e)
{
e.GraphicsDeviceInformation.PresentationParameters.DeviceWindowHandle = drawSurface;
}
示例2: graphics_PreparingDeviceSettings
private void graphics_PreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e)
{
DisplayMode displayMode = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode;
e.GraphicsDeviceInformation.PresentationParameters.BackBufferFormat = displayMode.Format;
e.GraphicsDeviceInformation.PresentationParameters.BackBufferWidth = displayMode.Width;
e.GraphicsDeviceInformation.PresentationParameters.BackBufferHeight = displayMode.Height;
}
示例3: CBeroGraphicsDeviceManager_PreparingDeviceSettings
void CBeroGraphicsDeviceManager_PreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e)
{
if (m_WndHndl != IntPtr.Zero)
{
e.GraphicsDeviceInformation.PresentationParameters.DeviceWindowHandle = m_WndHndl;
}
}
示例4: PreparingDeviceSettings
private void PreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e)
{
PresentationParameters presentationParams = e.GraphicsDeviceInformation.PresentationParameters;
presentationParams.BackBufferWidth = RenderWidth;
presentationParams.BackBufferHeight = RenderHeight;
presentationParams.DeviceWindowHandle = _windowHandle;
presentationParams.RenderTargetUsage = RenderTargetUsage.PreserveContents;
}
示例5: Graphics_PreparingDeviceSettings
private void Graphics_PreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e)
{
Graphics.PreferredBackBufferWidth = DefaultResolution.X;
Graphics.PreferredBackBufferHeight = DefaultResolution.Y;
//Graphics.GraphicsProfile = GraphicsProfile.HiDef;
Graphics.SynchronizeWithVerticalRetrace = true;
//Graphics.PreferredDepthStencilFormat = DepthFormat.Depth24Stencil8;
}
示例6: graphics_PreparingDeviceSettings
private void graphics_PreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e)
{
//graphics.IsFullScreen = true;
graphics.PreferredBackBufferWidth = 1280;
graphics.PreferredBackBufferHeight = 720;
graphics.PreferMultiSampling = true;
graphics.GraphicsProfile = GraphicsProfile.HiDef;
graphics.PreferredDepthStencilFormat = DepthFormat.Depth24Stencil8;
graphics.ApplyChanges();
}
示例7: OnPreparingDeviceSettings
protected override void OnPreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e)
{
e.GraphicsDeviceInformation.PresentationParameters.PresentationInterval = PresentInterval.One;
// use 4-bit (per channel) color format for WP7. Atleast Omnia 7 has a horrible banding with SurfaceFormat.Color.
// Lumia's don't probably have but whatever
if (OperatingSystemHelper.Version == WindowsPhoneVersion.WP7)
{
e.GraphicsDeviceInformation.PresentationParameters.BackBufferFormat = SurfaceFormat.Bgra4444;
}
}
示例8: graphics_PreparingDeviceSettings
void graphics_PreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e)
{
try
{
e.GraphicsDeviceInformation.PresentationParameters.PresentationInterval = PresentInterval.Two;
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
示例9: GraphicsPreparingDeviceSettings
private void GraphicsPreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e) {
var pp = e.GraphicsDeviceInformation.PresentationParameters;
var adapter = e.GraphicsDeviceInformation.Adapter;
var dispFormat = adapter.CurrentDisplayMode.Format;
var dephFormat = pp.DepthStencilFormat;
SurfaceFormat selectedFormat;
DepthFormat selectedDepthFormat;
int selectedMultiSampleCount;
if (adapter.QueryRenderTargetFormat(GraphicsProfile.HiDef, dispFormat, dephFormat, 4, out selectedFormat, out selectedDepthFormat, out selectedMultiSampleCount)) {
pp.MultiSampleCount = 4;
} else if (adapter.QueryRenderTargetFormat(GraphicsProfile.HiDef, dispFormat, dephFormat, 2, out selectedFormat, out selectedDepthFormat, out selectedMultiSampleCount)) {
pp.MultiSampleCount = 2;
}
}
示例10: graphics_PreparingDeviceSettings
private void graphics_PreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e)
{
nativeScreenWidth = graphics.PreferredBackBufferWidth;
nativeScreenHeight = graphics.PreferredBackBufferHeight;
if (nativeScreenWidth == 1920)
{
graphics.PreferredBackBufferWidth = 1920;
graphics.PreferredBackBufferHeight = 1080;
}
else
{
//graphics.PreferredBackBufferWidth = 1920;
//graphics.PreferredBackBufferHeight = 1080;
graphics.PreferredBackBufferWidth = 1280;
graphics.PreferredBackBufferHeight = 720;
//graphics.IsFullScreen = true;
}
graphics.PreferMultiSampling = true;
graphics.PreferredDepthStencilFormat = DepthFormat.Depth24Stencil8;
graphics.ApplyChanges();
}
示例11: InitialiseDevice
private void InitialiseDevice(object sender, PreparingDeviceSettingsEventArgs e)
{
PresentationParameters pp =
e.GraphicsDeviceInformation.PresentationParameters;
foreach (GraphicsAdapter adapter in GraphicsAdapter.Adapters)
{
if (adapter.Description.Contains("NVIDIA PerfHUD"))
{
GraphicsAdapter.UseReferenceDevice = true;
e.GraphicsDeviceInformation.Adapter = adapter;
break;
}
}
GraphicsAdapter defaultAdapter = GraphicsAdapter.DefaultAdapter;
//if ( defaultAdapter.IsWideScreen )
RenderManager.Instance.BaseResolution = new Vector2(1280, 720);
// else
// RenderManager.Instance.BaseResolution = new Vector2(1024, 768);
}
示例12: _graphics_PreparingDeviceSettings
void _graphics_PreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e)
{
PresentationParameters pp = e.GraphicsDeviceInformation.PresentationParameters;
pp.RenderTargetUsage = RenderTargetUsage.PreserveContents;
e.GraphicsDeviceInformation.PresentationParameters = pp;
}
示例13: GraphicsPreparingDeviceSettings
/// <summary>
/// We need to override this device settings callback so that the correct back buffer it set.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected override void GraphicsPreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e)
{
base.GraphicsPreparingDeviceSettings(sender, e);
// e.GraphicsDeviceInformation.PresentationParameters.BackBufferHeight = 960;
// e.GraphicsDeviceInformation.PresentationParameters.BackBufferWidth = 800;
}
示例14: GraphicsPreparingDeviceSettings
protected virtual void GraphicsPreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e)
{
e.GraphicsDeviceInformation.PresentationParameters.RenderTargetUsage = RenderTargetUsage.PreserveContents;
e.GraphicsDeviceInformation.PresentationParameters.DepthStencilFormat = DepthFormat.Depth24Stencil8;
e.GraphicsDeviceInformation.PresentationParameters.BackBufferFormat = SurfaceFormat.Color;
}
示例15: graphics_PreparingDeviceSettings
private void graphics_PreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e)
{
nativeScreenWidth = graphics.PreferredBackBufferWidth;
nativeScreenHeight = graphics.PreferredBackBufferHeight;
graphics.PreferredBackBufferWidth = 1280;
graphics.PreferredBackBufferHeight = 720;
graphics.PreferMultiSampling = true;
graphics.GraphicsProfile = GraphicsProfile.HiDef;
graphics.SynchronizeWithVerticalRetrace = true;
graphics.PreferredDepthStencilFormat = DepthFormat.Depth24Stencil8;
e.GraphicsDeviceInformation.PresentationParameters.MultiSampleCount = 16;
}