PDA

View Full Version : Draw To Bitmap problem



tsvetan
08-14-2000, 09:58 PM
Hello,
I have the following problem.
I want to store the result image after rendering into Bitmap for feature use.
So I make one Bitmap and I draw with OpenGL in it. When I draw directly to View's DC I get very good performance, but When I'm drawing into Bitmap it's more than 20 time slower. Why ? How I can get faster drawing ?
Or how I can get the resulting Image into Bitmap ?

Kilam Malik
08-15-2000, 12:18 AM
The drawing to bitmap is not hardware accelerated, because it happens in the main memory and not in the graphics card. You could render to the screen as normal and read the color buffer values and then store them. But the window must not be obscured.

Kilam.

tsvetan
08-15-2000, 01:06 AM
The problem is that I try the same technique but copy bits are also slow. Or may be I do it wrong?

onyXMaster
08-15-2000, 01:21 AM
Create a bitmap space with TexImage2D and the update it with CopyTex[Sub]Image2D ...
It's that simple and is hardware accelerated on a lot of consumer cards at least ( i.e. nVidia TNT/GeForce line )

tsvetan
08-15-2000, 01:52 AM
I'm agree with you, but as I know the different Video Card support different sizes for texture, and they are not so big. Suppose the resolution is 1600x1200 ? How I can create then such big texture ?

skippyj777
08-16-2000, 01:45 PM
Does glTexImage2D create a bitmap in video memory? Is that why it is faster than using CreateBitmap() bitmaps?