本文整理汇总了C#中OpenTK.GLControl.CreateGraphics方法的典型用法代码示例。如果您正苦于以下问题:C# GLControl.CreateGraphics方法的具体用法?C# GLControl.CreateGraphics怎么用?C# GLControl.CreateGraphics使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenTK.GLControl
的用法示例。
在下文中一共展示了GLControl.CreateGraphics方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoSetup
private void DoSetup()
{
////_MView.InitializeShading();
//var windowHandle = (IntPtr) _MView.GetViewHWndx64();
_MView.UpdateAllGraphicsLayers = true;
_MView.InitializeShading();
//Toolkit.Init();
//var windowInfo = Utilities.CreateWindowsWindowInfo(windowHandle);
////var context = new GraphicsContext(GraphicsMode.Default, windowInfo);
//var contextHandle = new ContextHandle(windowHandle);
//var context = new GraphicsContext(contextHandle, Wgl.GetProcAddress, () => contextHandle);
//context.MakeCurrent(windowInfo);
//context.LoadAll();
// TODO some resources are not disposed here.
// Really we should call `var tk = Toolkit.Init();` here (that's what `GLControl.ctor` does)
// and then dispose `tk`.
using (var ctrl = new GLControl())
using (ctrl.CreateGraphics())
{
}
//Toolkit.Init();
//IGraphicsContext context = new GraphicsContext(
// new ContextHandle(windowHandle),null );
//context.LoadAll();
}