OpenGL context without created Window

Started by Kai, July 08, 2008, 21:17:47

Previous topic - Next topic

Kai

Hi,

is it possible to initialize an OpenGL context without creating a window?

I want to use GPGPU with LWJGL using glsl shaders and would only render to FrameBufferObjects. Thus, I do not need a created window that pops up and must be Display.update()-d.

Regards,
Kai

Matzon


Kai

Well, sure, I could use pbuffers, but aren't they only available under MS Windows?

Matzon

no? - that would be a surprise to me at least!

Kai

Thanks for your replies!

While searching for some examples I stumpled over "http://lwjgl.org/wiki/doku.php/lwjgl/tutorials/opengl/pbuffervsfbo" which mentions some issues with pbuffers under Linux.

Nevertheless, I will give it a try with pbuffers.

Kai

PBuffers works perfectly in conjunction with FrameBuffer objects!

for those interested in my solution:

I saw some articles, especially on http://www.gpgpu.org/ which either uses pbuffer XOR uses FrameBuffer objects, but not both.
But I realized that pbuffers are NOT primarily a technique to render to a texture; pbuffers just give the user the ability to create an OpenGL context (with a render buffer) that can be rendered to without the need of creating a window handle.
Realizing that, I created myself a PBuffer and because copying render buffer contents to a texture (using glCopyTexSubImage2D) and afterwards reading the contents of that texture back into RAM (using glGetTexImage) would be too slow, I also used FrameBufferObjects on top of this, which saved me the "copy render buffer to texture" part.

Greetings,
Kai