wined3d: Update the glOrtho between 2 rhw draws if the viewport was changed.

This commit is contained in:
Stefan Dösinger 2006-02-13 13:25:21 +01:00 committed by Alexandre Julliard
parent 01d63a217a
commit 46e8d67787
4 changed files with 6 additions and 2 deletions

View File

@ -2695,6 +2695,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetViewport(IWineD3DDevice *iface, CONST WINED
TRACE("Recording... not performing anything\n");
return D3D_OK;
}
This->viewport_changed = TRUE;
ENTER_GL();

View File

@ -200,10 +200,11 @@ static BOOL primitiveInitState(IWineD3DDevice *iface, BOOL vtx_transformed, BOOL
if (!useVS && vtx_transformed) {
/* If the last draw was transformed as well, no need to reapply all the matrixes */
if (!This->last_was_rhw) {
if ( (!This->last_was_rhw) || (This->viewport_changed) ) {
double X, Y, height, width, minZ, maxZ;
This->last_was_rhw = TRUE;
This->viewport_changed = FALSE;
/* Transformed already into viewport coordinates, so we do not need transform
matrices. Reset all matrices to identity and leave the default matrix in world

View File

@ -708,10 +708,11 @@ HRESULT WINAPI IWineD3DSurfaceImpl_UnlockRect(IWineD3DSurface *iface) {
/* glDrawPixels transforms the raster position as though it was a vertex -
we want to draw at screen position 0,0 - Set up ortho (rhw) mode as
per drawprim (and leave set - it will sort itself out due to last_was_rhw */
if (!myDevice->last_was_rhw) {
if ( (!myDevice->last_was_rhw) || (myDevice->viewport_changed) ) {
double X, Y, height, width, minZ, maxZ;
myDevice->last_was_rhw = TRUE;
myDevice->viewport_changed = FALSE;
/* Transformed already into viewport coordinates, so we do not need transform
matrices. Reset all matrices to identity and leave the default matrix in world

View File

@ -494,6 +494,7 @@ typedef struct IWineD3DDeviceImpl
BOOL proj_valid;
BOOL view_ident; /* true iff view matrix is identity */
BOOL last_was_rhw; /* true iff last draw_primitive was in xyzrhw mode */
BOOL viewport_changed; /* Was the viewport changed since the last draw? */
GLenum tracking_parm; /* Which source is tracking current colour */
LONG tracking_color; /* used iff GL_COLOR_MATERIAL was enabled */
#define DISABLED_TRACKING 0 /* Disabled */