Way to reset the context of the current thread | OpenTK
Home » Discussion forums » Archives » Development Way to reset the context of the current thread Posted Wednesday, 30 January, 2008 - 18:32 by Hangar	inOpenTK Development
I've looked at a lot of OpenGL libraries, and I think this one has some potential. One problem I ran into was not being able to reset the context on the current thread so that other threads can use it. (I need this functionality for my threading model.) Any chance of getting a ResetCurrentContext static function?
The implementation would just call:
Wgl.Imports.MakeCurrent(IntPtr.Zero, IntPtr.Zero); for windows.
Glx.MakeCurrent(windowInfo.Display, IntPtr.Zero, IntPtr.Zero); for X.
Also, I'm interested in contributing if I can. I'd like to see an OSX native port and more advanced font layout sometime in the future.
‹ Scope of OpenTK.Utils.Fonts Consistency ›
Select your preferred way to display the comments and click "Save settings" to activate your changes. Welcome to the forum :)
Posted Wednesday, 30 January, 2008 - 22:03 by Inertia Welcome to the forum :)
Any chance of getting a ResetCurrentContext static function?
Fiddler is responsible for the OpenGL part and knows the current state of the context wrapper best, but I don't see any reason why this shouldn't be included.
Contributions are always welcome, but I'd recommend talking to Fiddler before starting any serious effort - solely to avoid duplicate work.
The only problem with MacOS is that all current developers are quite busy with their current tasks already, and none of us currently uses MacOS. The only 2 things that really need some care for the port are 1) the input drivers and 2) OpenGL context creation. Everything else is expected to compile with minor adjustments (if any at all).
Posted Wednesday, 30 January, 2008 - 23:20 by the Fiddler Welcome, indeed!
[ResetCurrentContext static function]
You are right, this functionality is missing. Will add!
[Advanced font layout]
What layout kinds do you need? The initial plan was to support left/right/center justification, left-to-right/right-to-left modes and optional grid-fitting (snapping glyphs to pixel boundaries). Fonts are in the back burner however, so I kinda hoped someone would show interest in contributing ;)
Alwin has expressed interest in a native implementation through GLUT. While this will help get an implementation up and running quickly, not all functionality can be replicated this way (e.g. monitor discovery, Windows.Forms integration), so a native Cocoa port would be the long-term goal for OSX.
Ok, you can now reset the current context of any thread through:
GLContext.CurrentContext = null;
Posted Thursday, 31 January, 2008 - 18:52 by Hangar Thanks for update.
Well, the emphasis is on "sometime in the future." I don't use a Mac either, but I know several people who wouldn't be able to use my programs unless there was a Mac port. At this point, I'm just glad you plan to support it in the future.
[Edited by TheFiddler: let's continue the font discussion at http://www.opentk.com/node/237, otherwise it might get lost!]
Re: Way to reset the context of the current thread
Posted Monday, 16 June, 2008 - 23:03 by jcornwall This thread is a little old, but I'm bumping because progress hasn't appeared in SVN and I need the functionality.
Fiddler, could you make the patch for resetting the current context available?
Recent activity	Problem compiling OpenTK Windows 10 & Quickfont errors Error "The imported type OpenTK.Vector3 is defined multiple times." on Xamarin.Mac GLControl inactive in ToolBox more
Way to reset the context of the current thread | OpenTK
Home » Discussion forums » Archives » Development Way to reset the context of the current thread Posted Wednesday, 30 January, 2008 - 18:32 by Hangar	inOpenTK Development
I've looked at a lot of OpenGL libraries, and I think this one has some potential. One problem I ran into was not being able to reset the context on the current thread so that other threads can use it. (I need this functionality for my threading model.) Any chance of getting a ResetCurrentContext static function?
The implementation would just call:
Wgl.Imports.MakeCurrent(IntPtr.Zero, IntPtr.Zero); for windows.
Glx.MakeCurrent(windowInfo.Display, IntPtr.Zero, IntPtr.Zero); for X.
Also, I'm interested in contributing if I can. I'd like to see an OSX native port and more advanced font layout sometime in the future.
‹ Scope of OpenTK.Utils.Fonts Consistency ›
Select your preferred way to display the comments and click "Save settings" to activate your changes. Welcome to the forum :)
Posted Wednesday, 30 January, 2008 - 22:03 by Inertia Welcome to the forum :)
Any chance of getting a ResetCurrentContext static function?
Fiddler is responsible for the OpenGL part and knows the current state of the context wrapper best, but I don't see any reason why this shouldn't be included.
Contributions are always welcome, but I'd recommend talking to Fiddler before starting any serious effort - solely to avoid duplicate work.
The only problem with MacOS is that all current developers are quite busy with their current tasks already, and none of us currently uses MacOS. The only 2 things that really need some care for the port are 1) the input drivers and 2) OpenGL context creation. Everything else is expected to compile with minor adjustments (if any at all).
Pos
ted Wednesday, 30 January, 2008 - 23:20 by the Fiddler Welcome, indeed!
[ResetCurrentContext static function]
You are right, this functionality is missing. Will add!
[Advanced font layout]
What layout kinds do you need? The initial plan was to support left/right/center justification, left-to-right/right-to-left modes and optional grid-fitting (snapping glyphs to pixel boundaries). Fonts are in the back burner however, so I kinda hoped someone would show interest in contributing ;)
Alwin has expressed interest in a native implementation through GLUT. While this will help get an implementation up and running quickly, not all functionality can be replicated this way (e.g. monitor discovery, Windows.Forms integration), so a native Cocoa port would be the long-term goal for OSX.
Ok, you can now reset the current context of any thread through:
GLContext.CurrentContext = null;
Posted Thursday, 31 January, 2008 - 18:52 by Hangar Thanks for update.
Well, the emphasis is on "sometime in the future." I don't use a Mac either, but I know several people who wouldn't be able to use my programs unless there was a Mac port. At this point, I'm just glad you plan to support it in the future.
[Edited by TheFiddler: let's continue the font discussion at http://www.opentk.com/node/237, otherwise it might get lost!]
Re: Way to reset the context of the current thread
Posted Monday, 16 June, 2008 - 23:03 by jcornwall This thread is a little old, but I'm bumping because progress hasn't appeared in SVN and I need the functionality.
Fiddler, could you make the patch for resetting the current context available?
Recent activity	Problem compiling OpenTK Windows 10 & Quickfont errors Error "The imported type OpenTK.Vector3 is defined multiple times." on Xamarin.Mac GLControl inactive in ToolBox more