I've been working for 3 days now to make this new API come to life:
bool SPrintWindowSetDIB(HWND hWnd, SPW_DIB *pDIB);
void SPrintWindowRestoreDIB(HWND hWnd);
With this API, you can SET a dib in which the window will actually paint.
It's NOT a copy, the window will really paint into that DIB.
However, there are some drawbacks: you MUST call SPrintWindowRestoreDIB() before your program exit !! Because if your program dies and the original DIB pointer hasn't been restored, you'll end up with a cute Blue Screen Of Death
You might not see what's the benefit of that API
Lemme tell you what I've just tried.
I made a Direct3D application in which I had a textured cube I could move around.
I locked the texture, to retrieve a pointer to the texture DIB, and I just set this DIB pointer to my window
And boom, the window was actually painting DIRECTLY (no copy) in the texture
In other words, I had a REAL TIME window wrapped in a Direct3D Cube
But here's another drawback, sometimes setting the DIB directly is slower than copying the entire DIB (when using it with textures). Why is that ? Lemme explain: in Direct3D, all the texture are transfered into VIDEO memory. But the transfer is done using AGP for WRITING only, READING is still done through PCI. And because PCI is MUCH slower than our DDR rams, if the windows kernel tries to read from the DIB, it will slow down the whole process.
But you will tell me, hey, what's the benefits of that method over the other one ?
Well, I would say that the speed you can use for refreshing the windows is limited by the AGP bus. So for one window it's good, but I had some real slow downs with 3 windows at the same time (size like 1000*800 pix), and what's the need to refresh a window if it's not drawing anything ? With this tecthnique, I shouldn't experience those slowdowns because the texture is updated directly by the system, so no problem
I am about to release the v0.1 version of the SPrintWindow library in one or two days
I didn't made a video because I just finished to test this API
siwu








Sign In »
Register Now!
Help

MultiQuote