Permalink
Browse files

[Graphics] Init OpenTK when creating external context

Fixes issue #52
  • Loading branch information...
1 parent 625ba5d commit 242b8bbe6c145a7fa400d56702a655522d558624 @thefiddler thefiddler committed Mar 13, 2014
Showing with 4 additions and 0 deletions.
  1. +4 −0 Source/OpenTK/Graphics/GraphicsContext.cs
View
4 Source/OpenTK/Graphics/GraphicsContext.cs
@@ -188,6 +188,10 @@ public GraphicsContext(ContextHandle handle, GetAddressDelegate getAddress, GetC
if (getAddress == null || getCurrent == null)
throw new ArgumentNullException();
+ // Make sure OpenTK has been initialized.
+ // Fixes https://github.com/opentk/opentk/issues/52
+ Toolkit.Init();
+
lock (SyncRoot)
{
// Replace a zero-handle by the current context, if any

0 comments on commit 242b8bb

Please sign in to comment.