
Enable WGL Access
Posted Saturday, 5 September, 2009 - 15:50 by Acidic32| Project: | The Open Toolkit library |
| Version: | all versions |
| Component: | Code |
| Category: | support request |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | by design |
Jump to:
Description
How can i enable WGL Access in OpenTK?
I dont want to include Tao's Platform class if possible
Thanks


Comments
#1
The WGL bindings are an implementation detail that is hidden by design. The only way to access them is to copy the code from Source/Platform/Windows/Bindings directly into your project.
Note that you'll need to create a context and call Wgl.LoadAll() prior to using any Wgl methods, otherwise you will get a NullReferenceException. This is necessary to ensure WGL extensions work correctly (Tao.Platform.Windows fails here).
However, I strongly suggest that you file a feature request against the GraphicsContext class instead of using WGL directly. If possible, we will expose the necessary functionality and make sure that it works correctly along the rest of OpenTK.
#2
Well all i really use it for is Text Printing as OpenTK's Text Printer seems to be slow compared to using the WGL method
#3
In that case, the simplest solution is to copy the two or three DllImports from WglCore.cs. This will bind you to the windows platform, though.
Another possibility is to use System.Drawing.Graphics to print text onto a System.Drawing.Bitmap and upload that to a texture. As long as you text doesn't change every frame, this is likely to be even faster than WGL.
#4
Not sure really...
#5
Not sure about what? :)
#6
What i need to take from the OpenTK Source to use WGL
;)
#7
This should be all:
#8
oh right, cheers now trying it ;)
#9
What is Wgl.Library ?
#10
Right, do i need to Load the Library?