本文整理汇总了C#中OpenTK.DisplayDevice.ChangeResolution方法的典型用法代码示例。如果您正苦于以下问题:C# DisplayDevice.ChangeResolution方法的具体用法?C# DisplayDevice.ChangeResolution怎么用?C# DisplayDevice.ChangeResolution使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenTK.DisplayDevice
的用法示例。
在下文中一共展示了DisplayDevice.ChangeResolution方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Create
//.........这里部分代码省略.........
case "top":
top = Int32.Parse( entry.Value.ToString() );
break;
case "fsaa":
fsaa = Int32.Parse( entry.Value.ToString() );
break;
case "colourDepth":
case "colorDepth":
colorDepth = Int32.Parse( entry.Value.ToString() );
break;
case "vsync":
vsync = entry.Value.ToString() == "No" ? false : true;
break;
case "displayFrequency":
displayFrequency = Int32.Parse( entry.Value.ToString() );
break;
case "depthBuffer":
depthBuffer = Int32.Parse( entry.Value.ToString() );
break;
case "border":
border = entry.Value.ToString().ToLower();
break;
case "externalWindowInfo":
glContext = new OpenTKGLContext( (OpenTK.Platform.IWindowInfo)entry.Value );
break;
case "externalWindowHandle":
object handle = entry.Value;
IntPtr ptr = IntPtr.Zero;
if ( handle.GetType() == typeof( IntPtr ) )
{
ptr = (IntPtr)handle;
}
else if ( handle.GetType() == typeof( System.Int32 ) )
{
ptr = new IntPtr( (int)handle );
}
//glContext = new OpenTKGLContext(Control.FromHandle(ptr), Control.FromHandle(ptr).Parent);
WindowEventMonitor.Instance.RegisterWindow( this );
fullScreen = false;
IsActive = true;
break;
case "externalWindow":
//glContext = new OpenTKGLContext((Control)entry.Value, ((Control)entry.Value).Parent);
WindowEventMonitor.Instance.RegisterWindow( this );
fullScreen = false;
IsActive = true;
break;
default:
break;
}
}
}
#endregion Parameter Handling
if ( glContext == null )
{
// create window
_window = new NativeWindow( width, height, title, GameWindowFlags.Default, new GraphicsMode( GraphicsMode.Default.ColorFormat, depthBuffer, GraphicsMode.Default.Stencil, FSAA ), displayDevice );
glContext = new OpenTKGLContext( _window.WindowInfo );
FileSystem.FileInfoList ico = ResourceGroupManager.Instance.FindResourceFileInfo( ResourceGroupManager.DefaultResourceGroupName, "AxiomIcon.ico" );
if ( ico.Count != 0 )
{
_window.Icon = System.Drawing.Icon.ExtractAssociatedIcon( ico[ 0 ].Filename );
}
if ( fullScreen )
{
displayDevice.ChangeResolution( width, height, ColorDepth, displayFrequency );
_window.WindowState = WindowState.Fullscreen;
IsFullScreen = true;
}
else
{
_window.WindowState = WindowState.Normal;
if ( border == "fixed" )
_window.WindowBorder = WindowBorder.Fixed;
else if ( border == "resizable" )
_window.WindowBorder = WindowBorder.Resizable;
else if ( border == "none" )
_window.WindowBorder = WindowBorder.Hidden;
}
_window.Title = title;
WindowEventMonitor.Instance.RegisterWindow( this );
// lets get active!
IsActive = true;
glContext.VSync = vsync;
_window.Visible = true;
}
}