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
31da3c05
Commit
31da3c05
authored
Dec 15, 2008
by
Stefan Dösinger
Committed by
Alexandre Julliard
Dec 16, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Emulate GL_EXT_fog_coord.
parent
d707f018
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
21 deletions
+27
-21
context.c
dlls/wined3d/context.c
+4
-0
gl_compat.c
dlls/wined3d/gl_compat.c
+0
-0
state.c
dlls/wined3d/state.c
+16
-21
wined3d_private.h
dlls/wined3d/wined3d_private.h
+7
-0
No files found.
dlls/wined3d/context.c
View file @
31da3c05
...
...
@@ -1615,3 +1615,7 @@ void ActivateContext(IWineD3DDeviceImpl *This, IWineD3DSurface *target, ContextU
FIXME
(
"Unexpected context usage requested
\n
"
);
}
}
WineD3DContext
*
getActiveContext
(
void
)
{
return
last_device
->
activeContext
;
}
dlls/wined3d/gl_compat.c
View file @
31da3c05
This diff is collapsed.
Click to expand it.
dlls/wined3d/state.c
View file @
31da3c05
...
...
@@ -988,7 +988,7 @@ static void state_fog(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCo
fogend
=
0
.
0
;
}
if
(
GL_SUPPORT
(
EXT_FOG_COORD
)
&&
context
->
fog_coord
)
{
if
(
context
->
fog_coord
)
{
glFogi
(
GL_FOG_COORDINATE_SOURCE_EXT
,
GL_FRAGMENT_DEPTH_EXT
);
checkGLcall
(
"glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FRAGMENT_DEPTH_EXT)"
);
context
->
fog_coord
=
FALSE
;
...
...
@@ -1029,7 +1029,7 @@ static void state_fog(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCo
default:
FIXME
(
"Unexpected WINED3DRS_FOGVERTEXMODE %d
\n
"
,
stateblock
->
renderState
[
WINED3DRS_FOGVERTEXMODE
]);
}
if
(
GL_SUPPORT
(
EXT_FOG_COORD
)
&&
context
->
fog_coord
)
{
if
(
context
->
fog_coord
)
{
glFogi
(
GL_FOG_COORDINATE_SOURCE_EXT
,
GL_FRAGMENT_DEPTH_EXT
);
checkGLcall
(
"glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FRAGMENT_DEPTH_EXT)"
);
context
->
fog_coord
=
FALSE
;
...
...
@@ -1049,7 +1049,7 @@ static void state_fog(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCo
if
(
!
context
->
last_was_rhw
)
{
glFogi
(
GL_FOG_MODE
,
GL_EXP
);
checkGLcall
(
"glFogi(GL_FOG_MODE, GL_EXP)"
);
if
(
GL_SUPPORT
(
EXT_FOG_COORD
)
&&
context
->
fog_coord
)
{
if
(
context
->
fog_coord
)
{
glFogi
(
GL_FOG_COORDINATE_SOURCE_EXT
,
GL_FRAGMENT_DEPTH_EXT
);
checkGLcall
(
"glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FRAGMENT_DEPTH_EXT)"
);
context
->
fog_coord
=
FALSE
;
...
...
@@ -1061,7 +1061,7 @@ static void state_fog(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCo
if
(
!
context
->
last_was_rhw
)
{
glFogi
(
GL_FOG_MODE
,
GL_EXP2
);
checkGLcall
(
"glFogi(GL_FOG_MODE, GL_EXP2)"
);
if
(
GL_SUPPORT
(
EXT_FOG_COORD
)
&&
context
->
fog_coord
)
{
if
(
context
->
fog_coord
)
{
glFogi
(
GL_FOG_COORDINATE_SOURCE_EXT
,
GL_FRAGMENT_DEPTH_EXT
);
checkGLcall
(
"glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FRAGMENT_DEPTH_EXT)"
);
context
->
fog_coord
=
FALSE
;
...
...
@@ -1073,7 +1073,7 @@ static void state_fog(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCo
if
(
!
context
->
last_was_rhw
)
{
glFogi
(
GL_FOG_MODE
,
GL_LINEAR
);
checkGLcall
(
"glFogi(GL_FOG_MODE, GL_LINEAR)"
);
if
(
GL_SUPPORT
(
EXT_FOG_COORD
)
&&
context
->
fog_coord
)
{
if
(
context
->
fog_coord
)
{
glFogi
(
GL_FOG_COORDINATE_SOURCE_EXT
,
GL_FRAGMENT_DEPTH_EXT
);
checkGLcall
(
"glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FRAGMENT_DEPTH_EXT)"
);
context
->
fog_coord
=
FALSE
;
...
...
@@ -1086,20 +1086,15 @@ static void state_fog(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCo
* color contains a fog factor. Set it in drawStridedSlow.
* Same happens with Vertexfog on transformed vertices
*/
if
(
GL_SUPPORT
(
EXT_FOG_COORD
))
{
if
(
context
->
fog_coord
==
FALSE
)
{
glFogi
(
GL_FOG_COORDINATE_SOURCE_EXT
,
GL_FOG_COORDINATE_EXT
);
checkGLcall
(
"glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FOG_COORDINATE_EXT)"
);
context
->
fog_coord
=
TRUE
;
}
glFogi
(
GL_FOG_MODE
,
GL_LINEAR
);
checkGLcall
(
"glFogi(GL_FOG_MODE, GL_LINEAR)"
);
fogstart
=
0xff
;
fogend
=
0x0
;
}
else
{
/* Disable GL fog, handle this in software in drawStridedSlow */
fogenable
=
FALSE
;
if
(
context
->
fog_coord
==
FALSE
)
{
glFogi
(
GL_FOG_COORDINATE_SOURCE_EXT
,
GL_FOG_COORDINATE_EXT
);
checkGLcall
(
"glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FOG_COORDINATE_EXT)"
);
context
->
fog_coord
=
TRUE
;
}
glFogi
(
GL_FOG_MODE
,
GL_LINEAR
);
checkGLcall
(
"glFogi(GL_FOG_MODE, GL_LINEAR)"
);
fogstart
=
0xff
;
fogend
=
0x0
;
break
;
}
default:
FIXME
(
"Unexpected WINED3DRS_FOGVERTEXMODE %d
\n
"
,
stateblock
->
renderState
[
WINED3DRS_FOGVERTEXMODE
]);
...
...
@@ -1113,7 +1108,7 @@ static void state_fog(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCo
case
WINED3DFOG_EXP
:
glFogi
(
GL_FOG_MODE
,
GL_EXP
);
checkGLcall
(
"glFogi(GL_FOG_MODE, GL_EXP)"
);
if
(
GL_SUPPORT
(
EXT_FOG_COORD
)
&&
context
->
fog_coord
)
{
if
(
context
->
fog_coord
)
{
glFogi
(
GL_FOG_COORDINATE_SOURCE_EXT
,
GL_FRAGMENT_DEPTH_EXT
);
checkGLcall
(
"glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FRAGMENT_DEPTH_EXT)"
);
context
->
fog_coord
=
FALSE
;
...
...
@@ -1123,7 +1118,7 @@ static void state_fog(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCo
case
WINED3DFOG_EXP2
:
glFogi
(
GL_FOG_MODE
,
GL_EXP2
);
checkGLcall
(
"glFogi(GL_FOG_MODE, GL_EXP2)"
);
if
(
GL_SUPPORT
(
EXT_FOG_COORD
)
&&
context
->
fog_coord
)
{
if
(
context
->
fog_coord
)
{
glFogi
(
GL_FOG_COORDINATE_SOURCE_EXT
,
GL_FRAGMENT_DEPTH_EXT
);
checkGLcall
(
"glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FRAGMENT_DEPTH_EXT)"
);
context
->
fog_coord
=
FALSE
;
...
...
@@ -1133,7 +1128,7 @@ static void state_fog(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCo
case
WINED3DFOG_LINEAR
:
glFogi
(
GL_FOG_MODE
,
GL_LINEAR
);
checkGLcall
(
"glFogi(GL_FOG_MODE, GL_LINEAR)"
);
if
(
GL_SUPPORT
(
EXT_FOG_COORD
)
&&
context
->
fog_coord
)
{
if
(
context
->
fog_coord
)
{
glFogi
(
GL_FOG_COORDINATE_SOURCE_EXT
,
GL_FRAGMENT_DEPTH_EXT
);
checkGLcall
(
"glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FRAGMENT_DEPTH_EXT)"
);
context
->
fog_coord
=
FALSE
;
...
...
dlls/wined3d/wined3d_private.h
View file @
31da3c05
...
...
@@ -800,6 +800,12 @@ struct WineD3DContext {
struct
fbo_entry
*
current_fbo
;
GLuint
src_fbo
;
GLuint
dst_fbo
;
/* Extension emulation */
BOOL
fog_enabled
;
GLint
gl_fog_source
;
GLfloat
fog_coord_value
;
GLfloat
color
[
4
],
fogstart
,
fogend
,
fogcolor
[
4
];
};
typedef
enum
ContextUsage
{
...
...
@@ -810,6 +816,7 @@ typedef enum ContextUsage {
}
ContextUsage
;
void
ActivateContext
(
IWineD3DDeviceImpl
*
device
,
IWineD3DSurface
*
target
,
ContextUsage
usage
);
WineD3DContext
*
getActiveContext
(
void
);
WineD3DContext
*
CreateContext
(
IWineD3DDeviceImpl
*
This
,
IWineD3DSurfaceImpl
*
target
,
HWND
win
,
BOOL
create_pbuffer
,
const
WINED3DPRESENT_PARAMETERS
*
pPresentParms
);
void
DestroyContext
(
IWineD3DDeviceImpl
*
This
,
WineD3DContext
*
context
);
void
context_resource_released
(
IWineD3DDevice
*
iface
,
IWineD3DResource
*
resource
,
WINED3DRESOURCETYPE
type
);
...
...
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