I want to run OpenGL without a window. How do I do that?

did you try glEnable(GL_NO_WINDOW) ?

There is no such thing as GL_NO_WINDOW.

I’m on Windows2K/XP. I’ve got GLUT, GLU, and GLAUX.

Create a window and hide it. Then create a pbuffer and use that as your rendering context.

I don’t want to have to make any windows calls. I want this to be as platform independant as possible.

#ifdef your code then

There’s got to be a better way.

Mesa has an offscreen renderer called OSMesa. No windowing code needed, just allocate a frame buffer, create a rendering context and you’re ready to go. Completely platform independent (the OpenGL part at least :slight_smile: ).

There is no better way. You will always have to create a window to create an OpenGL context, if you want acceleration.

Under windows, wglCreateContext(HDC) is the ONLY way to create a GL context. Try as many different device contexts as you want. Only DCs for windows with supported pixel formats will work.

There are a few non-accelerated options, such as Mesa, however.



I used glutFullScreen and got what I wanted - no window border. Windowless probably wasn’t the right way to describe what I was looking for.

The only difference is in glutFullScreen, it is #ifdef in glut’s code.

Ah, you meant without a “window border”, or as you described “fullscreen.”

“Windowless” actually means no visual interface at all, which some people would want to use for such things as offline rendering, or rendering as a service.

The quality of the answers is directly proportional to the quality of the questions.