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

Using OGL without opening window?

Started by InetRoadkill Jan 20, 2007 at 10:33 AM 6 replies 1.4k views
Original Post
InetRoadkill
InetRoadkill
Is it possible to gain access to openGL without actually opening/displaying a window? I would like to use it to do radiosity, but it would be nice to have it run without messing with the desktop (no resolution changes to desktop or a lot of screen flashing).
_the_phantom_
_the_phantom_
no, you need a window.
However the window doesn't have to be visable as you can always render to an fbo instead.
Yonibear
Yonibear
There is a possibility, the so-called PBuffers. They provide an own GL context, so you don't have to create a window.
Their main disadvantage in comparison to FBOs is that they are highly platform-dependent, since you have to fiddle with WGL/GLX-functions.
FBOs created form a context in a 1x1 window would be more portable, but would still require an open window. You may find this uglier, but beware that PBuffers also depend on a window system. For example neither of both techniques could be used on Linux without a running X-Server.
InetRoadkill
InetRoadkill
A 1:1 aspect ratio is what I'm looking for. Portability is not an issue for now, so if the trick only works on Windoze, that's ok. It just needs to be fast and support the normal OGL drawing functions.
Brother Bob
Brother Bob
If performance it not of greatest importance, have a look at Mesa. It offers a true off screen rendering context (OSMesa), which doesn't need any window at any point to render. And rendering is performed directly into a memory buffer you provide yourself.

A VERY nice solution for off screen image generation and doesn't even need a window manager present to run.

[Edited by - Brother Bob on January 20, 2007 7:44:40 PM]
_the_phantom_
_the_phantom_
Quote:
Original post by Yonibear
There is a possibility, the so-called PBuffers. They provide an own GL context, so you don't have to create a window.


The thing is, last I checked pbuffers were a wgl extension which required that a window is created to initalise OpenGL to gain access to the extension to create the pbuffer... or; you still need an inital window.

There is work going on for a windowless hardware accelerated opengl binding, however it's as yet to bare any fruit...

(this has got me wondering however if the ATI CTM stuff could be used for radiosity calculations without a window... curses, I was hoping to goto sleep soon.. ah well, off to read I go...)
zppz
zppz
Quote:
Original post by phantom
no, you need a window.
However the window doesn't have to be visable as you can always render to an fbo instead.


I guess this rules out being able to render on a machine without any desktop at all then. I have a database of avatars on a dedicated server (Linux), and I would like to be able to make a 2d 'photo' of peoples avatars after they change something. It doesn't have any 3d hardware (may not even have a video card at all), but the process doesn't need to be done in hardware and it doesn't need to be fast. Do I really need to have another PC connect to the database in order to get images like this?
Yonibear
Yonibear
@zppz:
Take another look on Brother Bob's post. OSMesa is exactly what you need. On Debian, there even should be packages for it.

@phantom:
Ok, i don't have any experience with WGL, only with the GLX extension. I just thought the extension had more or less the same functionality on Windows. Of course it was stupid to assume that something could be done on Win32 as elegant as on X11.

Topic Locked

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

Sign in to reply to this topic.