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
76beb5b7
Commit
76beb5b7
authored
Jan 05, 2003
by
Lionel Ulmer
Committed by
Alexandre Julliard
Jan 05, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Factorize the 'ortho' code (will be needed later on).
parent
2d7c07c7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
45 deletions
+34
-45
mesa.c
dlls/ddraw/d3ddevice/mesa.c
+28
-22
d3dexecutebuffer.c
dlls/ddraw/d3dexecutebuffer.c
+3
-23
mesa_private.h
dlls/ddraw/mesa_private.h
+3
-0
No files found.
dlls/ddraw/d3ddevice/mesa.c
View file @
76beb5b7
...
@@ -668,28 +668,10 @@ static void draw_primitive_handle_GL_state(IDirect3DDeviceImpl *This,
...
@@ -668,28 +668,10 @@ static void draw_primitive_handle_GL_state(IDirect3DDeviceImpl *This,
glEnable
(
GL_FOG
);
glEnable
(
GL_FOG
);
}
else
if
((
vertex_transformed
==
TRUE
)
&&
}
else
if
((
vertex_transformed
==
TRUE
)
&&
(
glThis
->
transform_state
!=
GL_TRANSFORM_ORTHO
))
{
(
glThis
->
transform_state
!=
GL_TRANSFORM_ORTHO
))
{
GLfloat
height
,
width
;
/* Set our orthographic projection */
GLfloat
trans_mat
[
16
];
glThis
->
transform_state
=
GL_TRANSFORM_ORTHO
;
d3ddevice_set_ortho
(
This
);
glThis
->
transform_state
=
GL_TRANSFORM_ORTHO
;
width
=
glThis
->
parent
.
surface
->
surface_desc
.
dwWidth
;
height
=
glThis
->
parent
.
surface
->
surface_desc
.
dwHeight
;
/* The X axis is straighforward.. For the Y axis, we need to convert 'D3D' screen coordinates
to OpenGL screen coordinates (ie the upper left corner is not the same).
For Z, the mystery is what should it be mapped to ? Ie should the resulting range be between
-1.0 and 1.0 (as the X and Y coordinates) or between 0.0 and 1.0 ? */
trans_mat
[
0
]
=
2
.
0
/
width
;
trans_mat
[
4
]
=
0
.
0
;
trans_mat
[
8
]
=
0
.
0
;
trans_mat
[
12
]
=
-
1
.
0
;
trans_mat
[
1
]
=
0
.
0
;
trans_mat
[
5
]
=
-
2
.
0
/
height
;
trans_mat
[
9
]
=
0
.
0
;
trans_mat
[
13
]
=
1
.
0
;
trans_mat
[
2
]
=
0
.
0
;
trans_mat
[
6
]
=
0
.
0
;
trans_mat
[
10
]
=
1
.
0
;
trans_mat
[
14
]
=
-
1
.
0
;
trans_mat
[
3
]
=
0
.
0
;
trans_mat
[
7
]
=
0
.
0
;
trans_mat
[
11
]
=
0
.
0
;
trans_mat
[
15
]
=
1
.
0
;
glMatrixMode
(
GL_MODELVIEW
);
glLoadIdentity
();
glMatrixMode
(
GL_PROJECTION
);
glLoadMatrixf
(
trans_mat
);
/* Remove also fogging... */
/* Remove also fogging... */
glDisable
(
GL_FOG
);
glDisable
(
GL_FOG
);
}
}
...
@@ -1901,6 +1883,30 @@ d3ddevice_bltfast(IDirectDrawSurfaceImpl *This, DWORD dstx,
...
@@ -1901,6 +1883,30 @@ d3ddevice_bltfast(IDirectDrawSurfaceImpl *This, DWORD dstx,
}
}
void
void
d3ddevice_set_ortho
(
IDirect3DDeviceImpl
*
This
)
{
GLfloat
height
,
width
;
GLfloat
trans_mat
[
16
];
width
=
This
->
surface
->
surface_desc
.
dwWidth
;
height
=
This
->
surface
->
surface_desc
.
dwHeight
;
/* The X axis is straighforward.. For the Y axis, we need to convert 'D3D' screen coordinates
to OpenGL screen coordinates (ie the upper left corner is not the same).
For Z, the mystery is what should it be mapped to ? Ie should the resulting range be between
-1.0 and 1.0 (as the X and Y coordinates) or between 0.0 and 1.0 ? */
trans_mat
[
0
]
=
2
.
0
/
width
;
trans_mat
[
4
]
=
0
.
0
;
trans_mat
[
8
]
=
0
.
0
;
trans_mat
[
12
]
=
-
1
.
0
;
trans_mat
[
1
]
=
0
.
0
;
trans_mat
[
5
]
=
-
2
.
0
/
height
;
trans_mat
[
9
]
=
0
.
0
;
trans_mat
[
13
]
=
1
.
0
;
trans_mat
[
2
]
=
0
.
0
;
trans_mat
[
6
]
=
0
.
0
;
trans_mat
[
10
]
=
1
.
0
;
trans_mat
[
14
]
=
-
1
.
0
;
trans_mat
[
3
]
=
0
.
0
;
trans_mat
[
7
]
=
0
.
0
;
trans_mat
[
11
]
=
0
.
0
;
trans_mat
[
15
]
=
1
.
0
;
glMatrixMode
(
GL_MODELVIEW
);
glLoadIdentity
();
glMatrixMode
(
GL_PROJECTION
);
glLoadMatrixf
(
trans_mat
);
}
void
d3ddevice_set_matrices
(
IDirect3DDeviceImpl
*
This
,
DWORD
matrices
,
d3ddevice_set_matrices
(
IDirect3DDeviceImpl
*
This
,
DWORD
matrices
,
D3DMATRIX
*
world_mat
,
D3DMATRIX
*
view_mat
,
D3DMATRIX
*
proj_mat
)
D3DMATRIX
*
world_mat
,
D3DMATRIX
*
view_mat
,
D3DMATRIX
*
proj_mat
)
{
{
...
...
dlls/ddraw/d3dexecutebuffer.c
View file @
76beb5b7
...
@@ -269,31 +269,11 @@ static void execute(IDirect3DExecuteBufferImpl *This,
...
@@ -269,31 +269,11 @@ static void execute(IDirect3DExecuteBufferImpl *This,
break
;
break
;
case
D3DVT_TLVERTEX
:
{
case
D3DVT_TLVERTEX
:
{
GLdouble
height
,
width
;
/* First, disable lighting and fogging */
GLfloat
trans_mat
[
16
];
/* First, disable lighting */
glDisable
(
GL_LIGHTING
);
glDisable
(
GL_LIGHTING
);
width
=
lpDevice
->
surface
->
surface_desc
.
dwWidth
;
height
=
lpDevice
->
surface
->
surface_desc
.
dwHeight
;
/* The X axis is straighforward.. For the Y axis, we need to convert 'D3D' screen coordinates
to OpenGL screen coordinates (ie the upper left corner is not the same).
For Z, the mystery is what should it be mapped to ? Ie should the resulting range be between
-1.0 and 1.0 (as the X and Y coordinates) or between 0.0 and 1.0 ? */
trans_mat
[
0
]
=
2
.
0
/
width
;
trans_mat
[
4
]
=
0
.
0
;
trans_mat
[
8
]
=
0
.
0
;
trans_mat
[
12
]
=
-
1
.
0
;
trans_mat
[
1
]
=
0
.
0
;
trans_mat
[
5
]
=
-
2
.
0
/
height
;
trans_mat
[
9
]
=
0
.
0
;
trans_mat
[
13
]
=
1
.
0
;
trans_mat
[
2
]
=
0
.
0
;
trans_mat
[
6
]
=
0
.
0
;
trans_mat
[
10
]
=
1
.
0
;
trans_mat
[
14
]
=
-
1
.
0
;
trans_mat
[
3
]
=
0
.
0
;
trans_mat
[
7
]
=
0
.
0
;
trans_mat
[
11
]
=
0
.
0
;
trans_mat
[
15
]
=
1
.
0
;
glMatrixMode
(
GL_MODELVIEW
);
glLoadIdentity
();
glMatrixMode
(
GL_PROJECTION
);
glLoadMatrixf
(
trans_mat
);
/* Remove also fogging... */
glDisable
(
GL_FOG
);
glDisable
(
GL_FOG
);
d3ddevice_set_ortho
(
lpDevice
);
}
break
;
}
break
;
default:
default:
...
...
dlls/ddraw/mesa_private.h
View file @
76beb5b7
...
@@ -164,6 +164,9 @@ extern HRESULT d3ddevice_find(IDirect3DImpl *d3d, LPD3DFINDDEVICESEARCH lpD3DDFS
...
@@ -164,6 +164,9 @@ extern HRESULT d3ddevice_find(IDirect3DImpl *d3d, LPD3DFINDDEVICESEARCH lpD3DDFS
/* Used to upload the texture */
/* Used to upload the texture */
extern
HRESULT
gltex_upload_texture
(
IDirectDrawSurfaceImpl
*
This
)
;
extern
HRESULT
gltex_upload_texture
(
IDirectDrawSurfaceImpl
*
This
)
;
/* Used to set-up our orthographic projection */
extern
void
d3ddevice_set_ortho
(
IDirect3DDeviceImpl
*
This
)
;
/* Common functions defined in d3dcommon.c */
/* Common functions defined in d3dcommon.c */
void
set_render_state
(
IDirect3DDeviceGLImpl
*
This
,
void
set_render_state
(
IDirect3DDeviceGLImpl
*
This
,
D3DRENDERSTATETYPE
dwRenderStateType
,
DWORD
dwRenderState
);
D3DRENDERSTATETYPE
dwRenderStateType
,
DWORD
dwRenderState
);
...
...
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