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
606186d4
Commit
606186d4
authored
Jun 21, 2008
by
Michael Karcher
Committed by
Alexandre Julliard
Jun 23, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Ensure to load wined3d before attempting to create a clipper.
parent
ebe77399
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
12 deletions
+35
-12
ddraw.c
dlls/ddraw/ddraw.c
+6
-0
ddraw_private.h
dlls/ddraw/ddraw_private.h
+3
-0
main.c
dlls/ddraw/main.c
+26
-12
No files found.
dlls/ddraw/ddraw.c
View file @
606186d4
...
...
@@ -3241,6 +3241,12 @@ DirectDrawCreateClipper(DWORD Flags,
return
CLASS_E_NOAGGREGATION
;
}
if
(
!
LoadWineD3D
())
{
LeaveCriticalSection
(
&
ddraw_cs
);
return
DDERR_NODIRECTDRAWSUPPORT
;
}
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
IDirectDrawClipperImpl
));
if
(
object
==
NULL
)
...
...
dlls/ddraw/ddraw_private.h
View file @
606186d4
...
...
@@ -644,6 +644,9 @@ void DDRAW_dump_cooperativelevel(DWORD cooplevel);
* IDirect3DExecuteBuffer isn't in WineD3D */
void
multiply_matrix
(
LPD3DMATRIX
dest
,
const
D3DMATRIX
*
src1
,
const
D3DMATRIX
*
src2
);
/* Helper function in main.c */
BOOL
LoadWineD3D
(
void
);
/* Used for generic dumping */
typedef
struct
{
...
...
dlls/ddraw/main.c
View file @
606186d4
...
...
@@ -49,7 +49,6 @@
typedef
IWineD3D
*
(
WINAPI
*
fnWineDirect3DCreate
)(
UINT
,
UINT
,
IUnknown
*
);
static
HMODULE
hWineD3D
=
(
HMODULE
)
-
1
;
static
fnWineDirect3DCreate
pWineDirect3DCreate
;
WINE_DEFAULT_DEBUG_CHANNEL
(
ddraw
);
...
...
@@ -72,6 +71,31 @@ CRITICAL_SECTION ddraw_cs = { &ddraw_cs_debug, -1, 0, 0, 0, 0 };
/* value of ForceRefreshRate */
DWORD
force_refresh_rate
=
0
;
/*
* Helper Function for DDRAW_Create and DirectDrawCreateClipper for
* lazy loading of the Wine D3D driver.
*
* Returns
* TRUE on success
* FALSE on failure.
*/
BOOL
LoadWineD3D
(
void
)
{
static
HMODULE
hWineD3D
=
(
HMODULE
)
-
1
;
if
(
hWineD3D
==
(
HMODULE
)
-
1
)
{
hWineD3D
=
LoadLibraryA
(
"wined3d"
);
if
(
hWineD3D
)
{
pWineDirect3DCreate
=
(
fnWineDirect3DCreate
)
GetProcAddress
(
hWineD3D
,
"WineDirect3DCreate"
);
pWineDirect3DCreateClipper
=
(
fnWineDirect3DCreateClipper
)
GetProcAddress
(
hWineD3D
,
"WineDirect3DCreateClipper"
);
return
TRUE
;
}
}
return
hWineD3D
!=
NULL
;
}
/***********************************************************************
*
* Helper function for DirectDrawCreate and friends
...
...
@@ -171,17 +195,7 @@ DDRAW_Create(const GUID *guid,
This
->
orig_width
=
GetSystemMetrics
(
SM_CXSCREEN
);
This
->
orig_height
=
GetSystemMetrics
(
SM_CYSCREEN
);
if
(
hWineD3D
==
(
HMODULE
)
-
1
)
{
hWineD3D
=
LoadLibraryA
(
"wined3d"
);
if
(
hWineD3D
)
{
pWineDirect3DCreate
=
(
fnWineDirect3DCreate
)
GetProcAddress
(
hWineD3D
,
"WineDirect3DCreate"
);
pWineDirect3DCreateClipper
=
(
fnWineDirect3DCreateClipper
)
GetProcAddress
(
hWineD3D
,
"WineDirect3DCreateClipper"
);
}
}
if
(
!
hWineD3D
)
if
(
!
LoadWineD3D
())
{
ERR
(
"Couldn't load WineD3D - OpenGL libs not present?
\n
"
);
hr
=
DDERR_NODIRECTDRAWSUPPORT
;
...
...
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