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
7facc690
Commit
7facc690
authored
Feb 25, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Feb 25, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Implement IWineD3DDeviceImpl_ClearRendertargetView().
parent
4817fbc3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
4 deletions
+70
-4
device.c
dlls/d3d10core/device.c
+6
-1
device.c
dlls/wined3d/device.c
+60
-3
wined3d.idl
include/wine/wined3d.idl
+4
-0
No files found.
dlls/d3d10core/device.c
View file @
7facc690
...
...
@@ -323,8 +323,13 @@ static void STDMETHODCALLTYPE d3d10_device_UpdateSubresource(ID3D10Device *iface
static
void
STDMETHODCALLTYPE
d3d10_device_ClearRenderTargetView
(
ID3D10Device
*
iface
,
ID3D10RenderTargetView
*
render_target_view
,
const
FLOAT
color_rgba
[
4
])
{
FIXME
(
"iface %p, render_target_view %p, color_rgba [%f %f %f %f] stub!
\n
"
,
struct
d3d10_device
*
This
=
(
struct
d3d10_device
*
)
iface
;
IWineD3DRendertargetView
*
wined3d_view
=
((
struct
d3d10_rendertarget_view
*
)
render_target_view
)
->
wined3d_view
;
TRACE
(
"iface %p, render_target_view %p, color_rgba [%f %f %f %f]
\n
"
,
iface
,
render_target_view
,
color_rgba
[
0
],
color_rgba
[
1
],
color_rgba
[
2
],
color_rgba
[
3
]);
IWineD3DDevice_ClearRendertargetView
(
This
->
wined3d_device
,
wined3d_view
,
color_rgba
);
}
static
void
STDMETHODCALLTYPE
d3d10_device_ClearDepthStencilView
(
ID3D10Device
*
iface
,
...
...
dlls/wined3d/device.c
View file @
7facc690
...
...
@@ -6219,7 +6219,9 @@ static IWineD3DSwapChain *get_swapchain(IWineD3DSurface *target) {
return
NULL
;
}
static
void
color_fill_fbo
(
IWineD3DDevice
*
iface
,
IWineD3DSurface
*
surface
,
CONST
WINED3DRECT
*
rect
,
WINED3DCOLOR
color
)
{
static
void
color_fill_fbo
(
IWineD3DDevice
*
iface
,
IWineD3DSurface
*
surface
,
const
WINED3DRECT
*
rect
,
const
float
color
[
4
])
{
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
IWineD3DSwapChain
*
swapchain
;
...
...
@@ -6267,7 +6269,7 @@ static void color_fill_fbo(IWineD3DDevice *iface, IWineD3DSurface *surface, CONS
glColorMask
(
GL_TRUE
,
GL_TRUE
,
GL_TRUE
,
GL_TRUE
);
IWineD3DDeviceImpl_MarkStateDirty
(
This
,
STATE_RENDER
(
WINED3DRS_COLORWRITEENABLE
));
glClearColor
(
D3DCOLOR_R
(
color
),
D3DCOLOR_G
(
color
),
D3DCOLOR_B
(
color
),
D3DCOLOR_A
(
color
)
);
glClearColor
(
color
[
0
],
color
[
1
],
color
[
2
],
color
[
3
]
);
glClear
(
GL_COLOR_BUFFER_BIT
);
checkGLcall
(
"glClear"
);
...
...
@@ -6406,7 +6408,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_ColorFill(IWineD3DDevice *iface, IWineD
}
if
(
wined3d_settings
.
offscreen_rendering_mode
==
ORM_FBO
)
{
color_fill_fbo
(
iface
,
pSurface
,
pRect
,
color
);
const
float
c
[
4
]
=
{
D3DCOLOR_R
(
color
),
D3DCOLOR_G
(
color
),
D3DCOLOR_B
(
color
),
D3DCOLOR_A
(
color
)};
color_fill_fbo
(
iface
,
pSurface
,
pRect
,
c
);
return
WINED3D_OK
;
}
else
{
/* Just forward this to the DirectDraw blitting engine */
...
...
@@ -6418,6 +6421,59 @@ static HRESULT WINAPI IWineD3DDeviceImpl_ColorFill(IWineD3DDevice *iface, IWineD
}
}
static
void
WINAPI
IWineD3DDeviceImpl_ClearRendertargetView
(
IWineD3DDevice
*
iface
,
IWineD3DRendertargetView
*
rendertarget_view
,
const
float
color
[
4
])
{
IWineD3DResource
*
resource
;
IWineD3DSurface
*
surface
;
HRESULT
hr
;
hr
=
IWineD3DRendertargetView_GetResource
(
rendertarget_view
,
&
resource
);
if
(
FAILED
(
hr
))
{
ERR
(
"Failed to get resource, hr %#x
\n
"
,
hr
);
return
;
}
if
(
IWineD3DResource_GetType
(
resource
)
!=
WINED3DRTYPE_SURFACE
)
{
FIXME
(
"Only supported on surface resources
\n
"
);
IWineD3DResource_Release
(
resource
);
return
;
}
surface
=
(
IWineD3DSurface
*
)
resource
;
if
(
wined3d_settings
.
offscreen_rendering_mode
==
ORM_FBO
)
{
color_fill_fbo
(
iface
,
surface
,
NULL
,
color
);
}
else
{
WINEDDBLTFX
BltFx
;
WINED3DCOLOR
c
;
WARN
(
"Converting to WINED3DCOLOR, this might give incorrect results
\n
"
);
c
=
((
DWORD
)(
color
[
2
]
*
255
.
0
));
c
|=
((
DWORD
)(
color
[
1
]
*
255
.
0
))
<<
8
;
c
|=
((
DWORD
)(
color
[
0
]
*
255
.
0
))
<<
16
;
c
|=
((
DWORD
)(
color
[
3
]
*
255
.
0
))
<<
24
;
/* Just forward this to the DirectDraw blitting engine */
memset
(
&
BltFx
,
0
,
sizeof
(
BltFx
));
BltFx
.
dwSize
=
sizeof
(
BltFx
);
BltFx
.
u5
.
dwFillColor
=
argb_to_fmt
(
c
,
((
IWineD3DSurfaceImpl
*
)
surface
)
->
resource
.
format
);
hr
=
IWineD3DSurface_Blt
(
surface
,
NULL
,
NULL
,
NULL
,
WINEDDBLT_COLORFILL
,
&
BltFx
,
WINED3DTEXF_NONE
);
if
(
FAILED
(
hr
))
{
ERR
(
"Blt failed, hr %#x
\n
"
,
hr
);
}
}
IWineD3DResource_Release
(
resource
);
}
/* rendertarget and depth stencil functions */
static
HRESULT
WINAPI
IWineD3DDeviceImpl_GetRenderTarget
(
IWineD3DDevice
*
iface
,
DWORD
RenderTargetIndex
,
IWineD3DSurface
**
ppRenderTarget
)
{
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
...
...
@@ -7710,6 +7766,7 @@ const IWineD3DDeviceVtbl IWineD3DDevice_Vtbl =
IWineD3DDeviceImpl_EndScene
,
IWineD3DDeviceImpl_Present
,
IWineD3DDeviceImpl_Clear
,
IWineD3DDeviceImpl_ClearRendertargetView
,
/*** Drawing ***/
IWineD3DDeviceImpl_DrawPrimitive
,
IWineD3DDeviceImpl_DrawIndexedPrimitive
,
...
...
include/wine/wined3d.idl
View file @
7facc690
...
...
@@ -3476,6 +3476,10 @@ interface IWineD3DDevice : IWineD3DBase
[
in
]
float
z
,
[
in
]
DWORD
stencil
)
;
void
ClearRendertargetView
(
[
in
]
IWineD3DRendertargetView
*
rendertarget_view
,
[
in
]
const
float
color
[
4
]
)
;
HRESULT
DrawPrimitive
(
[
in
]
WINED3DPRIMITIVETYPE
primitive_type
,
[
in
]
UINT
start_vertex
,
...
...
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