how to output the program to autocad

If I want to output my results to an AutoCad file .
how can do it ?

Try finding info about glRenderMode(GL_FEEDBACK)

You meant dwg or dxf?

dwg and dxf are all welcome .
I need convert the Opengl results (on the screen ) to an AutoCad file .
then I can view and reedit it AutoCad .
Though I know it is stupid .but I need to do it .

If you don’t have the source for whatever is rendering the data, then you’re mostly out of luck.

If you have the source, I’d suggest #define-ing all OpenGL functions you use to call some function pointer. You’d then be able to set these functions pointers up to call to OpenGL, or to call to your own implementation of the same functions. Your implementation would then capture the geometry in question, and write out the appropriately formatted data file on disk. has documentation on lots of file formats.