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
a13a5465
Commit
a13a5465
authored
Feb 11, 2014
by
Henri Verbeet
Committed by
Alexandre Julliard
Feb 11, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dxgi: Implement CreateDXGIFactory1().
parent
386d2aa8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
28 deletions
+39
-28
dxgi.spec
dlls/dxgi/dxgi.spec
+1
-0
dxgi_main.c
dlls/dxgi/dxgi_main.c
+7
-25
dxgi_private.h
dlls/dxgi/dxgi_private.h
+2
-1
factory.c
dlls/dxgi/factory.c
+29
-2
No files found.
dlls/dxgi/dxgi.spec
View file @
a13a5465
@ stdcall CreateDXGIFactory(ptr ptr)
@ stdcall CreateDXGIFactory1(ptr ptr)
@ stdcall DXGID3D10CreateDevice(ptr ptr ptr long ptr ptr)
@ stdcall DXGID3D10RegisterLayers(ptr long)
dlls/dxgi/dxgi_main.c
View file @
a13a5465
...
...
@@ -66,36 +66,18 @@ BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, void *reserved)
return
TRUE
;
}
HRESULT
WINAPI
CreateDXGIFactory
(
REFIID
riid
,
void
**
factory
)
HRESULT
WINAPI
CreateDXGIFactory
1
(
REFIID
riid
,
void
**
factory
)
{
struct
dxgi_factory
*
object
;
HRESULT
hr
;
TRACE
(
"riid %s, factory %p
\n
"
,
debugstr_guid
(
riid
),
factory
);
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
));
if
(
!
object
)
{
ERR
(
"Failed to allocate DXGI factory object memory
\n
"
);
*
factory
=
NULL
;
return
E_OUTOFMEMORY
;
}
hr
=
dxgi_factory_init
(
object
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to initialize swapchain, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
*
factory
=
NULL
;
return
hr
;
}
TRACE
(
"Created IDXGIFactory %p
\n
"
,
object
);
return
dxgi_factory_create
(
riid
,
factory
,
TRUE
);
}
hr
=
IDXGIFactory_QueryInterface
((
IDXGIFactory
*
)
object
,
riid
,
factory
);
IDXGIFactory_Release
((
IDXGIFactory
*
)
object
);
HRESULT
WINAPI
CreateDXGIFactory
(
REFIID
riid
,
void
**
factory
)
{
TRACE
(
"riid %s, factory %p
\n
"
,
debugstr_guid
(
riid
),
factory
);
return
hr
;
return
dxgi_factory_create
(
riid
,
factory
,
FALSE
)
;
}
static
BOOL
get_layer
(
enum
dxgi_device_layer_id
id
,
struct
dxgi_device_layer
*
layer
)
...
...
dlls/dxgi/dxgi_private.h
View file @
a13a5465
...
...
@@ -83,9 +83,10 @@ struct dxgi_factory
struct
wined3d
*
wined3d
;
UINT
adapter_count
;
IWineDXGIAdapter
**
adapters
;
BOOL
extended
;
};
HRESULT
dxgi_factory_
init
(
struct
dxgi_factory
*
factory
)
DECLSPEC_HIDDEN
;
HRESULT
dxgi_factory_
create
(
REFIID
riid
,
void
**
factory
,
BOOL
extended
)
DECLSPEC_HIDDEN
;
/* IDXGIDevice */
struct
dxgi_device
...
...
dlls/dxgi/factory.c
View file @
a13a5465
...
...
@@ -33,12 +33,14 @@ static inline struct dxgi_factory *impl_from_IWineDXGIFactory(IWineDXGIFactory *
static
HRESULT
STDMETHODCALLTYPE
dxgi_factory_QueryInterface
(
IWineDXGIFactory
*
iface
,
REFIID
riid
,
void
**
object
)
{
struct
dxgi_factory
*
factory
=
impl_from_IWineDXGIFactory
(
iface
);
TRACE
(
"iface %p, riid %s, object %p
\n
"
,
iface
,
debugstr_guid
(
riid
),
object
);
if
(
IsEqualGUID
(
riid
,
&
IID_IUnknown
)
||
IsEqualGUID
(
riid
,
&
IID_IDXGIObject
)
||
IsEqualGUID
(
riid
,
&
IID_IDXGIFactory
)
||
IsEqualGUID
(
riid
,
&
IID_IDXGIFactory1
)
||
(
factory
->
extended
&&
IsEqualGUID
(
riid
,
&
IID_IDXGIFactory1
)
)
||
IsEqualGUID
(
riid
,
&
IID_IWineDXGIFactory
))
{
IUnknown_AddRef
(
iface
);
...
...
@@ -318,7 +320,7 @@ static const struct IWineDXGIFactoryVtbl dxgi_factory_vtbl =
dxgi_factory_get_wined3d
,
};
HRESULT
dxgi_factory_init
(
struct
dxgi_factory
*
factory
)
static
HRESULT
dxgi_factory_init
(
struct
dxgi_factory
*
factory
,
BOOL
extended
)
{
HRESULT
hr
;
UINT
i
;
...
...
@@ -379,6 +381,8 @@ HRESULT dxgi_factory_init(struct dxgi_factory *factory)
factory
->
adapters
[
i
]
=
&
adapter
->
IWineDXGIAdapter_iface
;
}
factory
->
extended
=
extended
;
return
S_OK
;
fail:
...
...
@@ -388,3 +392,26 @@ fail:
LeaveCriticalSection
(
&
dxgi_cs
);
return
hr
;
}
HRESULT
dxgi_factory_create
(
REFIID
riid
,
void
**
factory
,
BOOL
extended
)
{
struct
dxgi_factory
*
object
;
HRESULT
hr
;
if
(
!
(
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
if
(
FAILED
(
hr
=
dxgi_factory_init
(
object
,
extended
)))
{
WARN
(
"Failed to initialize factory, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
return
hr
;
}
TRACE
(
"Created factory %p.
\n
"
,
object
);
hr
=
IWineDXGIFactory_QueryInterface
(
&
object
->
IWineDXGIFactory_iface
,
riid
,
factory
);
IWineDXGIFactory_Release
(
&
object
->
IWineDXGIFactory_iface
);
return
hr
;
}
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