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
b599e8e3
Commit
b599e8e3
authored
Apr 12, 2019
by
Henri Verbeet
Committed by
Alexandre Julliard
Apr 12, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Get rid of wined3d_device_init_gdi().
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0ffb1535
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
68 deletions
+34
-68
ddraw.c
dlls/ddraw/ddraw.c
+5
-8
device.c
dlls/wined3d/device.c
+29
-58
wined3d.spec
dlls/wined3d/wined3d.spec
+0
-1
wined3d.h
include/wine/wined3d.h
+0
-1
No files found.
dlls/ddraw/ddraw.c
View file @
b599e8e3
...
...
@@ -569,6 +569,9 @@ static HRESULT ddraw_attach_d3d_device(struct ddraw *ddraw,
TRACE
(
"ddraw %p.
\n
"
,
ddraw
);
if
(
ddraw
->
flags
&
DDRAW_NO3D
)
return
wined3d_device_init_3d
(
ddraw
->
wined3d_device
,
swapchain_desc
);
if
(
!
window
||
window
==
GetDesktopWindow
())
{
window
=
CreateWindowExA
(
0
,
DDRAW_WINDOW_CLASS_NAME
,
"Hidden D3D Window"
,
...
...
@@ -594,8 +597,7 @@ static HRESULT ddraw_attach_d3d_device(struct ddraw *ddraw,
/* Set this NOW, otherwise creating the depth stencil surface will cause a
* recursive loop until ram or emulated video memory is full. */
ddraw
->
flags
|=
DDRAW_D3D_INITIALIZED
;
hr
=
wined3d_device_init_3d
(
ddraw
->
wined3d_device
,
swapchain_desc
);
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
=
wined3d_device_init_3d
(
ddraw
->
wined3d_device
,
swapchain_desc
)))
{
ddraw
->
flags
&=
~
DDRAW_D3D_INITIALIZED
;
return
hr
;
...
...
@@ -638,12 +640,7 @@ static HRESULT ddraw_create_swapchain(struct ddraw *ddraw, HWND window, BOOL win
swapchain_desc
.
windowed
=
windowed
;
swapchain_desc
.
flags
=
WINED3D_SWAPCHAIN_ALLOW_MODE_SWITCH
;
if
(
!
(
ddraw
->
flags
&
DDRAW_NO3D
))
hr
=
ddraw_attach_d3d_device
(
ddraw
,
&
swapchain_desc
);
else
hr
=
wined3d_device_init_gdi
(
ddraw
->
wined3d_device
,
&
swapchain_desc
);
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
=
ddraw_attach_d3d_device
(
ddraw
,
&
swapchain_desc
)))
{
ERR
(
"Failed to create swapchain, hr %#x.
\n
"
,
hr
);
return
hr
;
...
...
dlls/wined3d/device.c
View file @
b599e8e3
...
...
@@ -1079,8 +1079,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device,
if
(
device
->
d3d_initialized
)
return
WINED3DERR_INVALIDCALL
;
if
(
device
->
wined3d
->
flags
&
WINED3D_NO3D
)
return
WINED3DERR_INVALIDCALL
;
memset
(
device
->
fb
.
render_targets
,
0
,
sizeof
(
device
->
fb
.
render_targets
));
...
...
@@ -1120,26 +1118,40 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device,
}
device
->
swapchains
[
0
]
=
swapchain
;
if
(
FAILED
(
hr
=
wined3d_device_create_primary_opengl_context
(
device
)))
goto
err_out
;
device_init_swapchain_state
(
device
,
swapchain
);
if
(
device
->
wined3d
->
flags
&
WINED3D_NO3D
)
{
if
(
!
(
device
->
blitter
=
wined3d_cpu_blitter_create
()))
{
ERR
(
"Failed to create CPU blitter.
\n
"
);
heap_free
(
device
->
swapchains
);
device
->
swapchain_count
=
0
;
goto
err_out
;
}
}
else
{
if
(
FAILED
(
hr
=
wined3d_device_create_primary_opengl_context
(
device
)))
goto
err_out
;
device_init_swapchain_state
(
device
,
swapchain
);
device
->
contexts
[
0
]
->
last_was_rhw
=
0
;
device
->
contexts
[
0
]
->
last_was_rhw
=
0
;
TRACE
(
"All defaults now set up.
\n
"
);
TRACE
(
"All defaults now set up.
\n
"
);
/* Clear the screen */
if
(
device
->
back_buffer_view
)
clear_flags
|=
WINED3DCLEAR_TARGET
;
if
(
swapchain_desc
->
enable_auto_depth_stencil
)
clear_flags
|=
WINED3DCLEAR_ZBUFFER
|
WINED3DCLEAR_STENCIL
;
if
(
clear_flags
)
wined3d_device_clear
(
device
,
0
,
NULL
,
clear_flags
,
&
black
,
1
.
0
f
,
0
);
/* Clear the screen */
if
(
device
->
back_buffer_view
)
clear_flags
|=
WINED3DCLEAR_TARGET
;
if
(
swapchain_desc
->
enable_auto_depth_stencil
)
clear_flags
|=
WINED3DCLEAR_ZBUFFER
|
WINED3DCLEAR_STENCIL
;
if
(
clear_flags
)
wined3d_device_clear
(
device
,
0
,
NULL
,
clear_flags
,
&
black
,
1
.
0
f
,
0
);
device
->
d3d_initialized
=
TRUE
;
device
->
d3d_initialized
=
TRUE
;
if
(
wined3d_settings
.
logo
)
device_load_logo
(
device
,
wined3d_settings
.
logo
);
}
if
(
wined3d_settings
.
logo
)
device_load_logo
(
device
,
wined3d_settings
.
logo
);
return
WINED3D_OK
;
err_out:
...
...
@@ -1153,47 +1165,6 @@ err_out:
return
hr
;
}
HRESULT
CDECL
wined3d_device_init_gdi
(
struct
wined3d_device
*
device
,
struct
wined3d_swapchain_desc
*
swapchain_desc
)
{
struct
wined3d_swapchain
*
swapchain
=
NULL
;
HRESULT
hr
;
TRACE
(
"device %p, swapchain_desc %p.
\n
"
,
device
,
swapchain_desc
);
/* Setup the implicit swapchain */
TRACE
(
"Creating implicit swapchain
\n
"
);
hr
=
device
->
device_parent
->
ops
->
create_swapchain
(
device
->
device_parent
,
swapchain_desc
,
&
swapchain
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to create implicit swapchain
\n
"
);
goto
err_out
;
}
device
->
swapchain_count
=
1
;
if
(
!
(
device
->
swapchains
=
heap_calloc
(
device
->
swapchain_count
,
sizeof
(
*
device
->
swapchains
))))
{
ERR
(
"Out of memory!
\n
"
);
goto
err_out
;
}
device
->
swapchains
[
0
]
=
swapchain
;
if
(
!
(
device
->
blitter
=
wined3d_cpu_blitter_create
()))
{
ERR
(
"Failed to create CPU blitter.
\n
"
);
heap_free
(
device
->
swapchains
);
device
->
swapchain_count
=
0
;
goto
err_out
;
}
return
WINED3D_OK
;
err_out:
wined3d_swapchain_decref
(
swapchain
);
return
hr
;
}
static
void
device_free_sampler
(
struct
wine_rb_entry
*
entry
,
void
*
context
)
{
struct
wined3d_sampler
*
sampler
=
WINE_RB_ENTRY_VALUE
(
entry
,
struct
wined3d_sampler
,
entry
);
...
...
dlls/wined3d/wined3d.spec
View file @
b599e8e3
...
...
@@ -121,7 +121,6 @@
@ cdecl wined3d_device_get_wined3d(ptr)
@ cdecl wined3d_device_incref(ptr)
@ cdecl wined3d_device_init_3d(ptr ptr)
@ cdecl wined3d_device_init_gdi(ptr ptr)
@ cdecl wined3d_device_multiply_transform(ptr long ptr)
@ cdecl wined3d_device_process_vertices(ptr long long long ptr ptr long long)
@ cdecl wined3d_device_release_focus_window(ptr)
...
...
include/wine/wined3d.h
View file @
b599e8e3
...
...
@@ -2364,7 +2364,6 @@ struct wined3d_sampler * __cdecl wined3d_device_get_vs_sampler(const struct wine
struct
wined3d
*
__cdecl
wined3d_device_get_wined3d
(
const
struct
wined3d_device
*
device
);
ULONG
__cdecl
wined3d_device_incref
(
struct
wined3d_device
*
device
);
HRESULT
__cdecl
wined3d_device_init_3d
(
struct
wined3d_device
*
device
,
struct
wined3d_swapchain_desc
*
swapchain_desc
);
HRESULT
__cdecl
wined3d_device_init_gdi
(
struct
wined3d_device
*
device
,
struct
wined3d_swapchain_desc
*
swapchain_desc
);
void
__cdecl
wined3d_device_multiply_transform
(
struct
wined3d_device
*
device
,
enum
wined3d_transform_state
state
,
const
struct
wined3d_matrix
*
matrix
);
HRESULT
__cdecl
wined3d_device_process_vertices
(
struct
wined3d_device
*
device
,
...
...
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