View Full Version : How to draw with OpenGL in memory instead of window ?
10-27-2003, 11:25 PM
I created some 3D scene with OpenGL and draw it on TForm(C++ Builder),but I'd like to write(save) all the picture stright to bmp file,and not show any window at all.
How to do it?How to manage drawing in memory?
I will be very glad about some sample code on
You are most likely after pbuffers. You can't get away from having a window, but once created you can hide the window and then draw to the pbuffer.
You can find lots of pbuffer examples on the nVidia web site (and, no doubt, ATI's as well). Once you have rendered to the pbuffer you can read it's contents and save it to whatever format you wish.
I believe there is also a method of rendering straight to a DIB, but I've never used it. If you search this forum you will find lots of info on pbuffers and related topics.
10-27-2003, 11:48 PM
Just render your scene to a texture or a pbuffer and then copy their content to memory for saving them to a file.
10-28-2003, 04:04 AM
Thanks for answers.
So there is no way to make it work without
Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.