View Full Version : fast 2D blitting?
06-09-2000, 02:41 AM
I want to copy a screen-sized image to the OpenGL window. Uploading the image as textures and then drawing them as triangles performed a way faster than glDrawPixels() but both are equally crap to me http://www.opengl.org/discussion_boards/ubb/frown.gif
DirectX drivers can do such a blit as I know it, so why can't GL drivers? Is there a way to copy a 2D image from the memory to the OpenGL viewport *fast*? I'm interested even if it's kinda hack or something...
In OpenGL, there's two ways to do this. Either you use glDrawPixels or draw a textured quad (yes, I read you post).
>> DirectX drivers can do such a blit as I know it, so why can't GL drivers?
What part of DirectX are you talking about? Direct3D has more or less the same limitation regarding bufferaccess as OpenGL. To access the framebuffer in OpenGL, you must wait till the pipeline is flushed, and I would be surprised if you don't have to wait for Direct3D to flush too.
If you wan't to do it fast without using textured quads, youre doomed.
And as a sidenote, this is the way you should do it in Direct3D too.
Well, unfortunately there is no official workaround for your problem and I never heard about a hack for this.
But then think about it, would a hack be really useful ? I mean, if you intend to distribute your code there are great chances that the hack won't work on others machines...
06-09-2000, 03:59 AM
Ooops, I think you get me wrong... Let me explain further:
OpenGL surface handling in Windows are done on GDI level (if you use Scitech MGL, DirectDraw can be chosen, too). I am not too familiar with neither GDI nor DirectDraw so I don't know if it's possible to draw into the GL frame buffer using GDI or DirectDraw functions and if it is so, how fast they are.
I need it for playing an animation in the background (unpacked to system memory in realtime and then copied to the GL screen) and drawing 3D objects on the top of it. Simple problem, uh? ;(
Well tarzan, the answer is still the same : uncompress your animation and upload the texture for each frame !
Actually I have done that with *.AVI files used as animated textures and it worked pretty well (ok, it's on Dual Pentium III 600 with GeForce DDR...).
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.