Does anyone know of an alternative to BitBlt, at the moment I'm using it to display my 512*512 back buffer on the DC but I can only manage 45FPS. Any suggestions, preferably not DirectX. Thanks
Posted on 2001-06-14 14:12:00 by Zadkiel
DirectX is the best way to go if speed is reqired ;) it gives you a pointer to video board memory...at least until version 7, 3d is required for DX8 ..ooops, besides it can work in a window also not only in full screen (so they say) But you can do all operations in a system memory matrix ant then at last use SetDIBits or smthing i cant remeber the exact name but there is a GDI function that gives u direct acces to a DC/Bitmap bits... In my experience a single or limited number of BitBlt's are pretty fast IF: -NO Streching -NO Color Matching -NO fancy ROP's However must i point it out to you that 45 FPS is good one? This message was edited by BogdanOntanu, on 6/14/2001 10:32:34 PM
Posted on 2001-06-14 22:29:00 by BogdanOntanu
Thanks, I'd say I will have to just use DirectX. The method I'm using is to do all operation in a memory DIB created with createdib or something, this is selected into a compatible DC and bitblted on the the main one. Your right that 45 FPS is pretty good, but it does drop an awful lot if I go for a bigger image. I wonder if you, or someone, can clear up a confusion of mine. What exactly does SelectObject do when I select the DIB into the back DC. I tried to cut out unnecessary operation repitition by createing a back DC and selecting the DIB into it only once. This is then removed when the program ends. Therefore to update the main dc only a single BitBlt is needed. Why is it though that when I select the DIB into the main DC nothing happens, yet when I blt from the back one, clearly theres an image in it. Its a pity I can't tell windows to access a block of memory I'd allocate for the DC. That way there would by no rendundant memory moving, it could acess one block for one frame, and a second one for the next frame, alternating every frame. Anyway, I'll probably go to DirectX, fullscreen is probably preferrable. This message was edited by Zadkiel, on 6/15/2001 7:08:29 PM
Posted on 2001-06-15 18:59:00 by Zadkiel
Just another thought, I've been messing around with OpenGL in windowed mode and it can achieve 450 FPS for the 512*512 window I've been on about. Now I know this is hardware and that explains the speed, but Can that be used. OpenGL uses two buffer does anyone know of a way to access these and set the bits. OpenGL has a command, glDrawPixels but this is slower than BitBlt so thats not the way to go, direct access to the bufferes is needed. Its a pity microsoft won't release the code for there OpenGL implementation, after all SGI did for the linux implementation. Any thoughts anyone.
Posted on 2001-06-17 08:19:00 by Zadkiel
OpenGl has very poor 2D implementation/functions ... close to none or not usable...:( its such a pitty...and this is the motive for so many ppl using DX/Directdraw (speed also)... So i belive u can not do anything for the 2D in OpenGL. But u can map the picture as a texture on a quad made of 2 coplanar triangles...and mimic a kinda of 2D with the speed advantages/accelerators of 3D. Bad news is that pixel operations /texture changes are slow again So i think u must use Directdraw 7...because DX8 is going in the same direction as OpenGl... i mean they kill 2D and speed and leave only 3D "visual programmer friendly" operations....like we all have to play DOOM clones for the next 100 years or so (i like DOOM but...too much is too much) our 2D game is using DirectDraw in DX7 and gets decent framerates (20-50) compared to the complexity of the software operations we make (full screen alpha blending, shadows, glow etc) with no help from the so called "3D hardware"
Posted on 2001-06-17 17:05:00 by BogdanOntanu
I made a little comparing tool which compares some blit operations, results are: BitBlt 900 SetDIBitsToDevice 6000 StretchBlt 9000 DrawDIB 50000 (times measured with QueryPerformanceCounter) All with a 320*240*24 bit bitmap, which is selected into a memory dc, or a allocated memory block. Screen is also 24 bit. Is there no way to access the current VGA device? I wonder if I can make something like GetCurrentVideoVXD VXD->BitBltReallyFast and also something like VXD->WaitForVerticalBlank without any DirectX? beaster.
Posted on 2001-06-19 05:40:00 by beaster
Hey beaster? I would like to see your code, if possible. My objective is to study the piece about speed test. I don't know very well about speed test. Thanks in advance.
Posted on 2001-06-19 15:05:00 by wolfao