本文整理汇总了C#中OpenTK.CreateCurrentContextDel方法的典型用法代码示例。如果您正苦于以下问题:C# OpenTK.CreateCurrentContextDel方法的具体用法?C# OpenTK.CreateCurrentContextDel怎么用?C# OpenTK.CreateCurrentContextDel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenTK
的用法示例。
在下文中一共展示了OpenTK.CreateCurrentContextDel方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GraphicsContext
///////////////////////////////////////////////////////////////////////////////////////////////////////////
//TODO: review here, this is our custom OpenGLContext
//eg, used with glfw
GraphicsContext(OpenTK.Platform.External.ExternalGraphicsContext externalGraphicsContext)
{
implementation = externalGraphicsContext;
lock (SyncRoot)
{
IsExternal = true;
//if (handle == ContextHandle.Zero)
//{
// implementation = new OpenTK.Platform.Dummy.DummyGLContext(handle);
//}
//else if (available_contexts.ContainsKey(handle))
//{
// throw new GraphicsContextException("Context already exists.");
//}
//else
//{
// switch ((flags & GraphicsContextFlags.Embedded) == GraphicsContextFlags.Embedded)
// {
// case false: implementation = Factory.Default.CreateGLContext(handle, window, shareContext, direct_rendering, major, minor, flags); break;
// case true: implementation = Factory.Embedded.CreateGLContext(handle, window, shareContext, direct_rendering, major, minor, flags); break;
// }
//}
available_contexts.Add((implementation as IGraphicsContextInternal).Context, new WeakReference(this));
(this as IGraphicsContextInternal).LoadAll();
GetCurrentContextDelegate temp = externalGraphicsContext.CreateCurrentContextDel();
if (temp != null)
{
GetCurrentContext = temp;
}
}
}