PDA

View Full Version : OpenGL rendering without DISPLAY



Ilgis Ibragimov
08-09-2009, 12:17 PM
Hi,

I am using OpenGL almost 10 years for scientific data visualization of many (millions) of triangles and it is operated in our C home made sources via

glBegin(...); glVertex3fv(...); glEnd();

All development is going on Linux, right now we are using Ubuntu.

Now I meet an interesting problem that I wish to ask you to help.

I would like to draw my object without opening X Window, and save the result in the PPM/JPG data. I used glReadPixels(...) to grab pictures, but it works only if I have X Window.

My program will work as http server and produce nice scientific pictures after http request, so, I need to do everything without opening X Window.

Please, advice em how to do it (if it is ever possible). A simple example of OpenGL initialization and dumping would be very appreciated.

Thank you

Ilgis

martinsm
08-09-2009, 12:27 PM
Maybe this will help: http://www.mesa3d.org/brianp/sig97/offscrn.htm

Ilgis Ibragimov
08-09-2009, 01:28 PM
Dear Martinsm,

thank you very much for your kind help. It works! Just normal mesa works ok, I cannot link glut functions from the demo/osmesa.c example, but I do not need them really.

Sincerely,

Ilgis

V-man
08-10-2009, 07:24 AM
Or, make a invisble GL window and then make a FBO for rendering.