PDA

View Full Version : using opengl without creating window



shivmitra
07-01-2011, 03:04 AM
I want to rotate an image using opengl and then save the image as bitmap . I am able to do that much .But the problem is that i dont want to create a window . Is it possible to do this ? i.e. i want opengl to do the math for me without initializing a window .

BionicBytes
07-01-2011, 03:55 AM
I thought that to get a context OpenGL will assign you a window (buffer) so you may not have a choice there.
However, nothing is stopping your Windows/Linux/Mac Window management code from simply setting the window properties so that it is not displayed. I have my Windows code such that I can get a full screen desktop, or a separate Window from the main application or set the OpenGL context to use a control (panel) on the main application as the 'window'. If you have a GUI interface to your app then you can do the latter and thus size the panel control to 1X1 pixels or just hide it behind something else.

Dark Photon
07-01-2011, 05:42 AM
Check out:
* ARB_glx_create_context (http://www.opengl.org/registry/specs/ARB/glx_create_context.txt)


If glXCreateContextAttribsARB succeeds, it initializes the context
to the initial state defined by the OpenGL specification, and
returns a handle to it. This handle can be used to render to any GLX
surface (window, pixmap, or pbuffer) compatible with <config>,

See this for some source code:

* http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&amp;Number=268825#Post2688 25

Instead of GLX_WINDOW_BIT, look at using GLX_PIXMAP_BIT or GLX_PBUFFER_BIT.

V-man
07-02-2011, 04:40 AM
I guess on *nix systems, you can do it with that extension but on Windows and other OSes, see the FAQ
http://www.opengl.org/wiki/FAQ#What_is_an_OpenGL_context.3F