Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
dfddf92e
Commit
dfddf92e
authored
Dec 16, 2002
by
Lionel Ulmer
Committed by
Alexandre Julliard
Dec 16, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Supports the ALPHAFUNC and ALPHAREF rendering states.
parent
841f6959
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
33 deletions
+47
-33
mesa.c
dlls/ddraw/d3ddevice/mesa.c
+3
-1
mesa.c
dlls/ddraw/mesa.c
+40
-32
mesa_private.h
dlls/ddraw/mesa_private.h
+4
-0
No files found.
dlls/ddraw/d3ddevice/mesa.c
View file @
dfddf92e
...
...
@@ -1662,7 +1662,9 @@ d3ddevice_create(IDirect3DDeviceImpl **obj, IDirect3DImpl *d3d, IDirectDrawSurfa
gl_object
->
render_state
.
dst
=
GL_ZERO
;
gl_object
->
render_state
.
mag
=
GL_NEAREST
;
gl_object
->
render_state
.
min
=
GL_NEAREST
;
gl_object
->
render_state
.
alpha_ref
=
0
.
0
;
/* No actual idea about the real default value... */
gl_object
->
render_state
.
alpha_func
=
GL_ALWAYS
;
/* Here either but it seems logical */
/* Allocate memory for the matrices */
gl_object
->
world_mat
=
(
D3DMATRIX
*
)
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
16
*
sizeof
(
float
));
gl_object
->
view_mat
=
(
D3DMATRIX
*
)
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
16
*
sizeof
(
float
));
...
...
dlls/ddraw/mesa.c
View file @
dfddf92e
...
...
@@ -30,6 +30,24 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
ddraw
);
GLenum
convert_D3D_compare_to_GL
(
D3DCMPFUNC
dwRenderState
)
{
switch
(
dwRenderState
)
{
case
D3DCMP_NEVER
:
return
GL_NEVER
;
case
D3DCMP_LESS
:
return
GL_LESS
;
case
D3DCMP_EQUAL
:
return
GL_EQUAL
;
case
D3DCMP_LESSEQUAL
:
return
GL_LEQUAL
;
case
D3DCMP_GREATER
:
return
GL_GREATER
;
case
D3DCMP_NOTEQUAL
:
return
GL_NOTEQUAL
;
case
D3DCMP_GREATEREQUAL
:
return
GL_GEQUAL
;
case
D3DCMP_ALWAYS
:
return
GL_ALWAYS
;
default:
ERR
(
"Unexpected compare type !!!
\n
"
);
return
GL_NEVER
;
}
}
void
set_render_state
(
D3DRENDERSTATETYPE
dwRenderStateType
,
DWORD
dwRenderState
,
RenderState
*
rs
)
{
...
...
@@ -66,9 +84,9 @@ void set_render_state(D3DRENDERSTATETYPE dwRenderStateType,
}
}
break
;
case
D3DRENDERSTATE_TEXTUREADDRESSU
:
case
D3DRENDERSTATE_TEXTUREADDRESSV
:
case
D3DRENDERSTATE_TEXTUREADDRESS
:
{
/* 3 */
case
D3DRENDERSTATE_TEXTUREADDRESSU
:
/* 44 */
case
D3DRENDERSTATE_TEXTUREADDRESSV
:
/* 45 */
case
D3DRENDERSTATE_TEXTUREADDRESS
:
{
/*
3 */
GLenum
arg
=
GL_REPEAT
;
/* Default value */
switch
((
D3DTEXTUREADDRESS
)
dwRenderState
)
{
case
D3DTADDRESS_WRAP
:
arg
=
GL_REPEAT
;
break
;
...
...
@@ -133,8 +151,15 @@ void set_render_state(D3DRENDERSTATETYPE dwRenderStateType,
else
glDepthMask
(
GL_FALSE
);
break
;
case
D3DRENDERSTATE_ALPHATESTENABLE
:
/* 15 */
if
(
dwRenderState
)
glEnable
(
GL_ALPHA_TEST
);
else
glDisable
(
GL_ALPHA_TEST
);
break
;
case
D3DRENDERSTATE_TEXTUREMAG
:
/* 17 */
case
D3DRENDERSTATE_TEXTUREMAG
:
/* 17 */
switch
((
D3DTEXTUREFILTER
)
dwRenderState
)
{
case
D3DFILTER_NEAREST
:
rs
->
mag
=
GL_NEAREST
;
...
...
@@ -218,34 +243,17 @@ void set_render_state(D3DRENDERSTATETYPE dwRenderStateType,
break
;
case
D3DRENDERSTATE_ZFUNC
:
/* 23 */
switch
((
D3DCMPFUNC
)
dwRenderState
)
{
case
D3DCMP_NEVER
:
glDepthFunc
(
GL_NEVER
);
break
;
case
D3DCMP_LESS
:
glDepthFunc
(
GL_LESS
);
break
;
case
D3DCMP_EQUAL
:
glDepthFunc
(
GL_EQUAL
);
break
;
case
D3DCMP_LESSEQUAL
:
glDepthFunc
(
GL_LEQUAL
);
break
;
case
D3DCMP_GREATER
:
glDepthFunc
(
GL_GREATER
);
break
;
case
D3DCMP_NOTEQUAL
:
glDepthFunc
(
GL_NOTEQUAL
);
break
;
case
D3DCMP_GREATEREQUAL
:
glDepthFunc
(
GL_GEQUAL
);
break
;
case
D3DCMP_ALWAYS
:
glDepthFunc
(
GL_ALWAYS
);
break
;
default:
ERR
(
"Unexpected value
\n
"
);
}
glDepthFunc
(
convert_D3D_compare_to_GL
(
dwRenderState
));
break
;
case
D3DRENDERSTATE_ALPHAREF
:
/* 24 */
rs
->
alpha_ref
=
dwRenderState
/
255
.
0
;
glAlphaFunc
(
rs
->
alpha_func
,
rs
->
alpha_ref
);
break
;
case
D3DRENDERSTATE_ALPHAFUNC
:
/* 25 */
rs
->
alpha_func
=
convert_D3D_compare_to_GL
(
dwRenderState
);
glAlphaFunc
(
rs
->
alpha_func
,
rs
->
alpha_ref
);
break
;
case
D3DRENDERSTATE_DITHERENABLE
:
/* 26 */
...
...
dlls/ddraw/mesa_private.h
View file @
dfddf92e
...
...
@@ -63,6 +63,10 @@ typedef struct render_state {
GLenum
src
,
dst
;
/* This is used for textures */
GLenum
mag
,
min
;
/* This is needed for the Alpha stuff */
GLenum
alpha_func
;
GLclampf
alpha_ref
;
}
RenderState
;
/* Common functions defined in d3dcommon.c */
...
...
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