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
e4b4c040
Commit
e4b4c040
authored
Dec 08, 2006
by
Stefan Dösinger
Committed by
Alexandre Julliard
Dec 08, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Move WINED3DRS_CULLMODE to the state table.
parent
bb564dc6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
40 deletions
+42
-40
device.c
dlls/wined3d/device.c
+1
-39
state.c
dlls/wined3d/state.c
+41
-1
No files found.
dlls/wined3d/device.c
View file @
e4b4c040
...
@@ -3439,46 +3439,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, W
...
@@ -3439,46 +3439,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, W
case
WINED3DRS_FILLMODE
:
case
WINED3DRS_FILLMODE
:
case
WINED3DRS_LIGHTING
:
case
WINED3DRS_LIGHTING
:
case
WINED3DRS_ZENABLE
:
case
WINED3DRS_ZENABLE
:
StateTable
[
STATE_RENDER
(
State
)].
apply
(
STATE_RENDER
(
State
),
This
->
stateBlock
);
break
;
case
WINED3DRS_CULLMODE
:
case
WINED3DRS_CULLMODE
:
StateTable
[
STATE_RENDER
(
State
)].
apply
(
STATE_RENDER
(
State
),
This
->
stateBlock
);
/* If we are culling "back faces with clockwise vertices" then
set front faces to be counter clockwise and enable culling
of back faces */
switch
((
WINED3DCULL
)
Value
)
{
case
WINED3DCULL_NONE
:
glDisable
(
GL_CULL_FACE
);
checkGLcall
(
"glDisable GL_CULL_FACE"
);
break
;
case
WINED3DCULL_CW
:
glEnable
(
GL_CULL_FACE
);
checkGLcall
(
"glEnable GL_CULL_FACE"
);
if
(
This
->
render_offscreen
)
{
glFrontFace
(
GL_CW
);
checkGLcall
(
"glFrontFace GL_CW"
);
}
else
{
glFrontFace
(
GL_CCW
);
checkGLcall
(
"glFrontFace GL_CCW"
);
}
glCullFace
(
GL_BACK
);
break
;
case
WINED3DCULL_CCW
:
glEnable
(
GL_CULL_FACE
);
checkGLcall
(
"glEnable GL_CULL_FACE"
);
if
(
This
->
render_offscreen
)
{
glFrontFace
(
GL_CCW
);
checkGLcall
(
"glFrontFace GL_CCW"
);
}
else
{
glFrontFace
(
GL_CW
);
checkGLcall
(
"glFrontFace GL_CW"
);
}
glCullFace
(
GL_BACK
);
break
;
default:
FIXME
(
"Unrecognized/Unhandled WINED3DCULL value %d
\n
"
,
Value
);
}
break
;
break
;
case
WINED3DRS_SHADEMODE
:
case
WINED3DRS_SHADEMODE
:
...
...
dlls/wined3d/state.c
View file @
e4b4c040
...
@@ -114,6 +114,46 @@ static void state_zenable(DWORD state, IWineD3DStateBlockImpl *stateblock) {
...
@@ -114,6 +114,46 @@ static void state_zenable(DWORD state, IWineD3DStateBlockImpl *stateblock) {
}
}
}
}
static
void
state_cullmode
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
)
{
/* TODO: Put this into the offscreen / onscreen rendering block due to device->render_offscreen */
/* If we are culling "back faces with clockwise vertices" then
set front faces to be counter clockwise and enable culling
of back faces */
switch
((
WINED3DCULL
)
stateblock
->
renderState
[
WINED3DRS_CULLMODE
])
{
case
WINED3DCULL_NONE
:
glDisable
(
GL_CULL_FACE
);
checkGLcall
(
"glDisable GL_CULL_FACE"
);
break
;
case
WINED3DCULL_CW
:
glEnable
(
GL_CULL_FACE
);
checkGLcall
(
"glEnable GL_CULL_FACE"
);
if
(
stateblock
->
wineD3DDevice
->
render_offscreen
)
{
glFrontFace
(
GL_CW
);
checkGLcall
(
"glFrontFace GL_CW"
);
}
else
{
glFrontFace
(
GL_CCW
);
checkGLcall
(
"glFrontFace GL_CCW"
);
}
glCullFace
(
GL_BACK
);
break
;
case
WINED3DCULL_CCW
:
glEnable
(
GL_CULL_FACE
);
checkGLcall
(
"glEnable GL_CULL_FACE"
);
if
(
stateblock
->
wineD3DDevice
->
render_offscreen
)
{
glFrontFace
(
GL_CCW
);
checkGLcall
(
"glFrontFace GL_CCW"
);
}
else
{
glFrontFace
(
GL_CW
);
checkGLcall
(
"glFrontFace GL_CW"
);
}
glCullFace
(
GL_BACK
);
break
;
default:
FIXME
(
"Unrecognized/Unhandled WINED3DCULL value %d
\n
"
,
stateblock
->
renderState
[
WINED3DRS_CULLMODE
]);
}
}
const
struct
StateEntry
StateTable
[]
=
const
struct
StateEntry
StateTable
[]
=
{
{
/* State name representative, apply function */
/* State name representative, apply function */
...
@@ -139,7 +179,7 @@ const struct StateEntry StateTable[] =
...
@@ -139,7 +179,7 @@ const struct StateEntry StateTable[] =
{
/* 19, WINED3DRS_SRCBLEND */
STATE_RENDER
(
WINED3DRS_ALPHABLENDENABLE
),
state_unknown
},
{
/* 19, WINED3DRS_SRCBLEND */
STATE_RENDER
(
WINED3DRS_ALPHABLENDENABLE
),
state_unknown
},
{
/* 20, WINED3DRS_DESTBLEND */
STATE_RENDER
(
WINED3DRS_ALPHABLENDENABLE
),
state_unknown
},
{
/* 20, WINED3DRS_DESTBLEND */
STATE_RENDER
(
WINED3DRS_ALPHABLENDENABLE
),
state_unknown
},
{
/* 21, WINED3DRS_TEXTUREMAPBLEND */
0
/* Handled in ddraw */
,
state_undefined
},
{
/* 21, WINED3DRS_TEXTUREMAPBLEND */
0
/* Handled in ddraw */
,
state_undefined
},
{
/* 22, WINED3DRS_CULLMODE */
STATE_RENDER
(
WINED3DRS_CULLMODE
),
state_
unknown
},
{
/* 22, WINED3DRS_CULLMODE */
STATE_RENDER
(
WINED3DRS_CULLMODE
),
state_
cullmode
},
{
/* 23, WINED3DRS_ZFUNC */
STATE_RENDER
(
WINED3DRS_ZFUNC
),
state_unknown
},
{
/* 23, WINED3DRS_ZFUNC */
STATE_RENDER
(
WINED3DRS_ZFUNC
),
state_unknown
},
{
/* 24, WINED3DRS_ALPHAREF */
STATE_RENDER
(
WINED3DRS_ALPHATESTENABLE
),
state_unknown
},
{
/* 24, WINED3DRS_ALPHAREF */
STATE_RENDER
(
WINED3DRS_ALPHATESTENABLE
),
state_unknown
},
{
/* 25, WINED3DRS_ALPHAFUNC */
STATE_RENDER
(
WINED3DRS_ALPHATESTENABLE
),
state_unknown
},
{
/* 25, WINED3DRS_ALPHAFUNC */
STATE_RENDER
(
WINED3DRS_ALPHATESTENABLE
),
state_unknown
},
...
...
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