Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
5b8b7764
Commit
5b8b7764
authored
May 25, 2006
by
Stefan Dösinger
Committed by
Alexandre Julliard
May 25, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Small rhw vertex fix.
Fix the one pixel displacement and move the glOrtho code in a common function.
parent
fc6ffb29
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
113 deletions
+47
-113
drawprim.c
dlls/wined3d/drawprim.c
+44
-42
surface.c
dlls/wined3d/surface.c
+2
-69
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-2
No files found.
dlls/wined3d/drawprim.c
View file @
5b8b7764
...
...
@@ -180,6 +180,49 @@ static GLfloat invymat[16] = {
0
.
0
f
,
0
.
0
f
,
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
};
void
d3ddevice_set_ortho
(
IWineD3DDeviceImpl
*
This
)
{
/* If the last draw was transformed as well, no need to reapply all the matrixes */
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
mode. */
glMatrixMode
(
GL_MODELVIEW
);
checkGLcall
(
"glMatrixMode(GL_MODELVIEW)"
);
glLoadIdentity
();
checkGLcall
(
"glLoadIdentity"
);
glMatrixMode
(
GL_PROJECTION
);
checkGLcall
(
"glMatrixMode(GL_PROJECTION)"
);
glLoadIdentity
();
checkGLcall
(
"glLoadIdentity"
);
/* Set up the viewport to be full viewport */
X
=
This
->
stateBlock
->
viewport
.
X
;
Y
=
This
->
stateBlock
->
viewport
.
Y
;
height
=
This
->
stateBlock
->
viewport
.
Height
;
width
=
This
->
stateBlock
->
viewport
.
Width
;
minZ
=
This
->
stateBlock
->
viewport
.
MinZ
;
maxZ
=
This
->
stateBlock
->
viewport
.
MaxZ
;
TRACE
(
"Calling glOrtho with %f, %f, %f, %f
\n
"
,
width
,
height
,
-
minZ
,
-
maxZ
);
glOrtho
(
X
,
X
+
width
,
Y
+
height
,
Y
,
-
minZ
,
-
maxZ
);
checkGLcall
(
"glOrtho"
);
/* Window Coord 0 is the middle of the first pixel, so translate by half
a pixel (See comment above glTranslate below) */
glTranslatef
(
0
.
375
,
0
.
375
,
0
);
checkGLcall
(
"glTranslatef(0.375, 0.375, 0)"
);
if
(
This
->
renderUpsideDown
)
{
glMultMatrixf
(
invymat
);
checkGLcall
(
"glMultMatrixf(invymat)"
);
}
}
}
/* Setup views - Transformed & lit if RHW, else untransformed.
Only unlit if Normals are supplied
Returns: Whether to restore lighting afterwards */
...
...
@@ -198,48 +241,7 @@ 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
)
||
(
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
mode. */
glMatrixMode
(
GL_MODELVIEW
);
checkGLcall
(
"glMatrixMode(GL_MODELVIEW)"
);
glLoadIdentity
();
checkGLcall
(
"glLoadIdentity"
);
glMatrixMode
(
GL_PROJECTION
);
checkGLcall
(
"glMatrixMode(GL_PROJECTION)"
);
glLoadIdentity
();
checkGLcall
(
"glLoadIdentity"
);
/* Set up the viewport to be full viewport */
X
=
This
->
stateBlock
->
viewport
.
X
;
Y
=
This
->
stateBlock
->
viewport
.
Y
;
height
=
This
->
stateBlock
->
viewport
.
Height
;
width
=
This
->
stateBlock
->
viewport
.
Width
;
minZ
=
This
->
stateBlock
->
viewport
.
MinZ
;
maxZ
=
This
->
stateBlock
->
viewport
.
MaxZ
;
TRACE
(
"Calling glOrtho with %f, %f, %f, %f
\n
"
,
width
,
height
,
-
minZ
,
-
maxZ
);
glOrtho
(
X
,
X
+
width
,
Y
+
height
,
Y
,
-
minZ
,
-
maxZ
);
checkGLcall
(
"glOrtho"
);
/* Window Coord 0 is the middle of the first pixel, so translate by half
a pixel (See comment above glTranslate below) */
glTranslatef
(
0
.
5
,
0
.
5
,
0
);
checkGLcall
(
"glTranslatef(0.5, 0.5, 0)"
);
if
(
This
->
renderUpsideDown
)
{
glMultMatrixf
(
invymat
);
checkGLcall
(
"glMultMatrixf(invymat)"
);
}
}
d3ddevice_set_ortho
(
This
);
}
else
{
/* Untransformed, so relies on the view and projection matrices */
...
...
dlls/wined3d/surface.c
View file @
5b8b7764
...
...
@@ -780,41 +780,7 @@ 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
)
||
(
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
mode. */
glMatrixMode
(
GL_MODELVIEW
);
checkGLcall
(
"glMatrixMode"
);
glLoadIdentity
();
checkGLcall
(
"glLoadIdentity"
);
glMatrixMode
(
GL_PROJECTION
);
checkGLcall
(
"glMatrixMode"
);
glLoadIdentity
();
checkGLcall
(
"glLoadIdentity"
);
/* Set up the viewport to be full viewport */
X
=
myDevice
->
stateBlock
->
viewport
.
X
;
Y
=
myDevice
->
stateBlock
->
viewport
.
Y
;
height
=
myDevice
->
stateBlock
->
viewport
.
Height
;
width
=
myDevice
->
stateBlock
->
viewport
.
Width
;
minZ
=
myDevice
->
stateBlock
->
viewport
.
MinZ
;
maxZ
=
myDevice
->
stateBlock
->
viewport
.
MaxZ
;
TRACE
(
"Calling glOrtho with %f, %f, %f, %f
\n
"
,
width
,
height
,
-
minZ
,
-
maxZ
);
glOrtho
(
X
,
X
+
width
,
Y
+
height
,
Y
,
-
minZ
,
-
maxZ
);
checkGLcall
(
"glOrtho"
);
/* Window Coord 0 is the middle of the first pixel, so translate by half
a pixel (See comment above glTranslate below) */
glTranslatef
(
0
.
5
,
0
.
5
,
0
);
checkGLcall
(
"glTranslatef(0.5, 0.5, 0)"
);
}
d3ddevice_set_ortho
(
This
->
resource
.
wineD3DDevice
);
if
(
iface
==
implSwapChain
->
backBuffer
||
iface
==
myDevice
->
renderTarget
)
{
glDrawBuffer
(
GL_BACK
);
...
...
@@ -2192,40 +2158,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT *
/* Draw a textured quad
*/
if
(
TRUE
)
{
double
X
,
Y
,
height
,
width
,
minZ
,
maxZ
;
myDevice
->
last_was_rhw
=
FALSE
;
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
mode. */
glMatrixMode
(
GL_MODELVIEW
);
checkGLcall
(
"glMatrixMode"
);
glLoadIdentity
();
checkGLcall
(
"glLoadIdentity"
);
glMatrixMode
(
GL_PROJECTION
);
checkGLcall
(
"glMatrixMode"
);
glLoadIdentity
();
checkGLcall
(
"glLoadIdentity"
);
/* Set up the viewport to be full viewport */
X
=
myDevice
->
stateBlock
->
viewport
.
X
;
Y
=
myDevice
->
stateBlock
->
viewport
.
Y
;
height
=
myDevice
->
stateBlock
->
viewport
.
Height
;
width
=
myDevice
->
stateBlock
->
viewport
.
Width
;
minZ
=
myDevice
->
stateBlock
->
viewport
.
MinZ
;
maxZ
=
myDevice
->
stateBlock
->
viewport
.
MaxZ
;
TRACE
(
"Calling glOrtho with %f, %f, %f, %f
\n
"
,
width
,
height
,
-
minZ
,
-
maxZ
);
glOrtho
(
X
,
X
+
width
,
Y
+
height
,
Y
,
-
minZ
,
-
maxZ
);
checkGLcall
(
"glOrtho"
);
/* Window Coord 0 is the middle of the first pixel, so translate by half
a pixel (See comment above glTranslate below) */
glTranslatef
(
0
.
375
,
0
.
375
,
0
);
checkGLcall
(
"glTranslatef(0.375, 0.375, 0)"
);
}
d3ddevice_set_ortho
(
This
->
resource
.
wineD3DDevice
);
glBegin
(
GL_QUADS
);
...
...
dlls/wined3d/wined3d_private.h
View file @
5b8b7764
...
...
@@ -597,8 +597,7 @@ typedef struct PrivateData
DWORD
size
;
}
PrivateData
;
/* OpenGL ortho matrix setup */
void
d3ddevice_set_ortho
(
IWineD3DDeviceImpl
*
This
,
BOOL
dontclip
);
void
d3ddevice_set_ortho
(
IWineD3DDeviceImpl
*
This
);
/*****************************************************************************
* IWineD3DResource implementation structure
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment