[3/9] WineD3D: Beware of the frontbuffer coordinate system difference
stefan at codeweavers.com
Sun Aug 3 01:34:29 CDT 2008
This patch handles the frontbuffer size differences in the blitting
functions rather than the function that sets up the coordinate system. The
old patches were wrong, and this is why:
The D3D backbuffer does not change when the window size is changed. This
holds true in our data structures. The OpenGL drawable size changes though.
The current(now unmodified) code puts the origin of the coordinate system on
the top left pixel of the surface. If it used the opengl drawable's size, it
would place it top the top left of the gl drawable, thus potentially outside
the surface. The scissor rectangle and viewport setup code does the same.
When we're drawing to the front buffer, we have to keep the actual drawable
size in mind though, when we're mapping screen coordinates to window
coordinates. Now drawing to the front buffer is possible in those two ways:
* D3D drawing in fullscreen mode. GL drawable size == Window size, no
special size mapping is needed
* Blitting to the front buffer in either fullscreen or windowed mode. This
is what this patch takes care of.
On an implementation side, note that the FBO and non-fbo correction is not
entirely the same. the non-fbo one happens in a coordinate system where the
origin is the top left pixel of the window(as set up by CTXUSAGE_BLIT),
while in fbo it is the bottom-left pixel(plain GL drawable coordinates, no
transforms apply to fbo_blit)
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 0 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20080803/6290ca21/attachment.bin
More information about the wine-patches