OpenGL surfaces / blitting / memory access

I would like to use 2D and 3D animation in one window. Is there a
feasible way to blit to an OpenGL surface? I tried this approach: create
an OpenGL texture from a surface and (in ortho mode) apply it to a quad
that covers the window’s client area. That works for non-changing
pictures (eg. a background picture) or reasonably small animated
textures. But when I want to animate a bitmap of let’s say 640x480 in
real time, I find it’s too slow because I have to call gluBuild2DMipmaps
every frame. I would like to access the bitmap memory of the OpenGL
surface directly. I can see the picture on the screen, so it must be
somewhere in the memory.–
Jonas Santoso
@Jonas_Santoso


http://www.fastmail.fm - The professional email service

I would like to use 2D and 3D animation in one window. Is there a
feasible way to blit to an OpenGL surface? I tried this approach: create
an OpenGL texture from a surface and (in ortho mode) apply it to a quad
that covers the window’s client area. That works for non-changing
pictures (eg. a background picture) or reasonably small animated
textures.

But when I want to animate a bitmap of let’s say 640x480 in real time,
I find it’s too slow because I have to call gluBuild2DMipmaps every
frame.

No, you do NOT need mipmaps for quads to the screen in projection mode.
(Actually, you never actually /need/ mipmaps, but things in the distance
will look better and be rendered a little quicker with them.)

I would like to access the bitmap memory of the OpenGL surface
directly. I can see the picture on the screen, so it must be somewhere
in the memory.

Er, you /really/ don’t.

The frame buffer lives in video memory, on the video card. OpenGL
provides calls to read from and write to the frame buffer, but it is
slow, and thus not really useful for this.On Sat, Mar 20, 2004 at 05:17:56PM +0100, Jonas Santoso wrote:


1024D/E65A7801 Zephaniah E. Hull <@Zephaniah_E_Hull>
92ED 94E4 B1E6 3624 226D 5727 4453 008B E65A 7801
CCs of replies from mailing lists are requested.

“First they came for the fourth amendment, but I said nothing because I
wasn’t a drug dealer. Then they came for the sixth amendment, but I kept
quiet because I wasn’t guilty. Finally they came for the first
amendment, and by then it was too late to say anything at all.”