Skip to main content
GameDev.net gamedev.net
🔒 Locked

OpenGL context with no window system

Started by ttpaus May 14, 2009 at 8:02 AM 6 replies 9.6k views
Original Post
ttpaus
ttpaus
Hi, I trying to do offscreen rendering on a server and looking for a way to create the OpenGL context without any attached Window. I'm new to OpenGL and haven't found a way to this. Thanks in advance!
Brother Bob
Brother Bob
All you need is a layer that can create rendering contexts without windows. WGL cannot, for example, but Mesa's off-screen renderer layer can; clicky. All you do it allocate a frame buffer, create the context with that buffer, do the rendering, and you have the final image in the buffer.
ma_hty
ma_hty
I remembered that when FBO is introduced, a mechanism within OpenGL framework for creating OpenGL context is also introduced. However, I'm not very sure about it.
V-man
V-man
Quote:
Original post by ma_hty
I remembered that when FBO is introduced, a mechanism within OpenGL framework for creating OpenGL context is also introduced. However, I'm not very sure about it.


No, FBO doesnt have mechanism for anything.

For p-buffer, you create a context, but this bitch is complex and you still need a window context to get function pointers. Just make the fucking window invisible.
Fiddler
Fiddler
Make your window invisible *and* render to an FBO.

Once the main window goes invisible, the main framebuffer goes into an undefined state - hence the need for FBOs.
[OpenTK: C# OpenGL 4.4, OpenGL ES 3.0 and OpenAL 1.1. Now with Linux/KMS support!]
samoth
samoth
Quote:
Original post by Fiddler
Make your window invisible *and* render to an FBO.
The likely reason he didn't do that in the first place is...
Quote:
trying to do offscreen rendering on a server
...that there is no windowing system running (and probably no accelerated graphics hardware available, either).

So yes, MESA as pointed out by Brother Bob would be it, if anything.
V-man
V-man
Quote:
Original post by samoth
Quote:
Original post by Fiddler
Make your window invisible *and* render to an FBO.
The likely reason he didn't do that in the first place is...
Quote:
trying to do offscreen rendering on a server
...that there is no windowing system running (and probably no accelerated graphics hardware available, either).

So yes, MESA as pointed out by Brother Bob would be it, if anything.


Brother Bob's answer is good but it depends on what the OP needs. If we are talking about a Windows server, there should be a windowing system. Also, hw acceleration might be desirable for speed. MESA is software only on Windows.

On Linux, I guess the user won't have a windowing system so there is no GL support in which case, the MESA offscreen renderer should do the job.
If there is a windowing system, then perfect, make an invisible window.

Since the OP says "without any attached Window", I was guessing the possibility to make a window exists.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.