
Initialization of OpenGL without Window
Posted Sunday, 11 November, 2012 - 17:54 by 147 inI hope I make no mistake in asking this question, if please say and I will remember it for the future.
I want to use OpenGL for image processing and computer vision, and therefore I use OpenTK.
The problem I have, is that I have to create a Context, but I have no windows?
How can I initialize a context without having a window?


Comments
Re: Initialization of OpenGL without Window
I'm not sure I understand what you are looking to do
Re: Initialization of OpenGL without Window
Theoretically, there is one way: http://www.khronos.org/registry/egl/extensions/KHR/EGL_KHR_surfaceless_c...
Practically, it is only available under Linux with Mesa drivers, since IHVs rarely bother themselves with implementing EGL in their drivers, not to mention EGL extensions.
It will be easier to make hidden window of any kind to workaround this, or destroy window right after context creation.
Re: Initialization of OpenGL without Window
@ lid6j86 I want to use OpenGL for a Image processing library and I think from the Point of programming a class library shouldn't create a window.
Perhaps it is a Little bit of Topic, but would OpenCL be a good alternative? Can I send a Picture to the GPU with OpenCL and process it?
Re: Initialization of OpenGL without Window
Yes you can. But I'd suggest you to take a look at opengl 4.3 compute shaders, it's simpler and suited exactly to solve image processing tasks.
Re: Initialization of OpenGL without Window
Can ComputeShaders be used without initialization of a device? And are ComputeShaders allready implemented in OpenTK, and is there a Little good tutorial about them?
And a question which may also interesting.
Is it possible to Transfer a Image to the GPU with OpenCL so that it can be used by DirectX or OpenGL?
Re: Initialization of OpenGL without Window
Can ComputeShaders be used without initialization of a device?
No, you still need window to get OpenGL context.
And are ComputeShaders allready implemented in OpenTK, and is there a Little good tutorial about them?
Probably not, AFAIK OpenTK does not support OpenGL4.3.
Is it possible to Transfer a Image to the GPU with OpenCL so that it can be used by DirectX or OpenGL?
You can share resources (incl images stored in GPU memory) between OpenCL and OpenGL. If your IHV is Nvidia, you may read/write DirectX resources from OpenGL via their DirectX interop OpenGL extension.