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
5ce986f1
Commit
5ce986f1
authored
Apr 04, 2010
by
Henri Verbeet
Committed by
Alexandre Julliard
Apr 05, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Add a separate function for wined3d object initialization.
parent
57fb1633
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
25 deletions
+43
-25
directx.c
dlls/wined3d/directx.c
+22
-2
wined3d_main.c
dlls/wined3d/wined3d_main.c
+20
-20
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-3
No files found.
dlls/wined3d/directx.c
View file @
5ce986f1
...
...
@@ -5020,7 +5020,7 @@ static void fillGLAttribFuncs(const struct wined3d_gl_info *gl_info)
}
}
BOOL
InitAdapters
(
IWineD3DImpl
*
This
)
static
BOOL
InitAdapters
(
IWineD3DImpl
*
This
)
{
static
HMODULE
mod_gl
;
BOOL
ret
;
...
...
@@ -5318,7 +5318,7 @@ nogl_adapter:
* IWineD3D VTbl follows
**********************************************************/
cons
t
IWineD3DVtbl
IWineD3D_Vtbl
=
static
const
struc
t
IWineD3DVtbl
IWineD3D_Vtbl
=
{
/* IUnknown */
IWineD3DImpl_QueryInterface
,
...
...
@@ -5348,3 +5348,23 @@ const struct wined3d_parent_ops wined3d_null_parent_ops =
{
wined3d_null_wined3d_object_destroyed
,
};
HRESULT
wined3d_init
(
IWineD3DImpl
*
wined3d
,
UINT
version
,
IUnknown
*
parent
)
{
wined3d
->
lpVtbl
=
&
IWineD3D_Vtbl
;
wined3d
->
dxVersion
=
version
;
wined3d
->
ref
=
1
;
wined3d
->
parent
=
parent
;
if
(
!
InitAdapters
(
wined3d
))
{
WARN
(
"Failed to initialize adapters.
\n
"
);
if
(
version
>
7
)
{
MESSAGE
(
"Direct3D%u is not available without OpenGL.
\n
"
,
version
);
return
E_FAIL
;
}
}
return
WINED3D_OK
;
}
dlls/wined3d/wined3d_main.c
View file @
5ce986f1
...
...
@@ -75,27 +75,27 @@ wined3d_settings_t wined3d_settings =
FALSE
/* Disable multisampling for now due to Nvidia driver bugs which happens for some users */
};
IWineD3D
*
WINAPI
WineDirect3DCreate
(
UINT
dxVersion
,
IUnknown
*
parent
)
{
IWineD3DImpl
*
object
;
IWineD3D
*
WINAPI
WineDirect3DCreate
(
UINT
version
,
IUnknown
*
parent
)
{
IWineD3DImpl
*
object
;
HRESULT
hr
;
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
IWineD3DImpl
));
object
->
lpVtbl
=
&
IWineD3D_Vtbl
;
object
->
dxVersion
=
dxVersion
;
object
->
ref
=
1
;
object
->
parent
=
parent
;
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
));
if
(
!
object
)
{
ERR
(
"Failed to allocate wined3d object memory.
\n
"
);
return
NULL
;
}
if
(
!
InitAdapters
(
object
))
hr
=
wined3d_init
(
object
,
version
,
parent
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to initialize direct3d adapters, Direct3D will not be available
\n
"
);
if
(
dxVersion
>
7
)
{
ERR
(
"Direct3D%d is not available without opengl
\n
"
,
dxVersion
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
return
NULL
;
}
WARN
(
"Failed to initialize wined3d object, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
return
NULL
;
}
TRACE
(
"Created
WineD3D object @ %p for d3d%d support
\n
"
,
object
,
dxV
ersion
);
TRACE
(
"Created
wined3d object %p for d3d%d support.
\n
"
,
object
,
v
ersion
);
return
(
IWineD3D
*
)
object
;
}
...
...
@@ -120,7 +120,7 @@ static void CDECL wined3d_do_nothing(void)
{
}
static
BOOL
wined3d_init
(
HINSTANCE
hInstDLL
)
static
BOOL
wined3d_
dll_
init
(
HINSTANCE
hInstDLL
)
{
DWORD
wined3d_context_tls_idx
;
HMODULE
mod
;
...
...
@@ -333,7 +333,7 @@ static BOOL wined3d_init(HINSTANCE hInstDLL)
return
TRUE
;
}
static
BOOL
wined3d_destroy
(
HINSTANCE
hInstDLL
)
static
BOOL
wined3d_d
ll_d
estroy
(
HINSTANCE
hInstDLL
)
{
DWORD
wined3d_context_tls_idx
=
context_get_tls_idx
();
unsigned
int
i
;
...
...
@@ -473,10 +473,10 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
switch
(
fdwReason
)
{
case
DLL_PROCESS_ATTACH
:
return
wined3d_init
(
hInstDLL
);
return
wined3d_
dll_
init
(
hInstDLL
);
case
DLL_PROCESS_DETACH
:
return
wined3d_destroy
(
hInstDLL
);
return
wined3d_d
ll_d
estroy
(
hInstDLL
);
case
DLL_THREAD_DETACH
:
{
...
...
dlls/wined3d/wined3d_private.h
View file @
5ce986f1
...
...
@@ -1567,11 +1567,9 @@ typedef struct IWineD3DImpl
struct
wined3d_adapter
adapters
[
1
];
}
IWineD3DImpl
;
extern
const
IWineD3DVtbl
IWineD3D_Vtbl
DECLSPEC_HIDDEN
;
HRESULT
wined3d_init
(
IWineD3DImpl
*
wined3d
,
UINT
version
,
IUnknown
*
parent
)
DECLSPEC_HIDDEN
;
BOOL
wined3d_register_window
(
HWND
window
,
struct
IWineD3DDeviceImpl
*
device
)
DECLSPEC_HIDDEN
;
void
wined3d_unregister_window
(
HWND
window
)
DECLSPEC_HIDDEN
;
BOOL
InitAdapters
(
IWineD3DImpl
*
This
)
DECLSPEC_HIDDEN
;
/* A helper function that dumps a resource list */
void
dumpResources
(
struct
list
*
list
)
DECLSPEC_HIDDEN
;
...
...
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