Commit 46e8d677 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

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

parent 01d63a21
......@@ -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();
......
......@@ -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
......
......@@ -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
......
......@@ -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 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment