OpenGL 描画面を画像として保存する

glReadPixels() でピクセル情報とってきて,他のライブラリにまわすっきゃない?
簡単な方法を調べ中.下はメモ.

JPEGで保存のサンプルプログラム
http://www.asahi-net.or.jp/~yw3t-trns/opengl/samples/imgsavejpeg/index.htm


mkOpenGLJPEGImage (シェアウェア.無料Trial.Freeバージョンもある?)

gdライブラリ http://www.boutell.com/gd/
Imlib
gdk_imlib

DevIL http://openil.sourceforge.net/

http://larse-gtk.hp.infoseek.co.jp/imlib.html


以下,引用 http://www.opengl.org/resources/faq/technical/miscellaneous.htm


To save a rendering, the easiest method is to use any of a
number of image utilities that let you capture the screen or
window, and save it is a file.

To accomplish this programmatically, you read your image
with glReadPixels(), and use the image data as input to a
routine that creates image files.

Similarly, to read an image file and use it as a texture
map, you need a routine that will read the image file. Then
send the texture data to OpenGL with glTexImage2D().

OpenGL will not read or write image files for you. To read
or write image files, you can either write your own code,
include code that someone else has written, or call into an
image file library. The following links contain information
on all three strategies.

This file format
information
covers a variety of different file formats.

The Independent JPEG Group has a free library for reading and
writing JPEG files
.

You can save your rendering as a JPEG image file, plus
load JPEG and BMP files directly into OpenGL texture objects,
using the C++
mkOpenGLJPEGImage class
.

Source code for reading TGA files
can be found here
.

The gd library lets
you create JPG and PNG files
from within your program.

Imlib (search the
"Download" section) is a wrapper library that
allows a program to write out JPEG, GIF, PNG, and TIFF files.

An
image loader library in Delphi can be found here
.