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
61125221
Commit
61125221
authored
Jan 18, 2007
by
H. Verbeet
Committed by
Alexandre Julliard
Jan 19, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Move SetupFullscreenWindow() and RestoreWindow() from IDirectDrawImpl…
wined3d: Move SetupFullscreenWindow() and RestoreWindow() from IDirectDrawImpl to IWineD3DDeviceImpl.
parent
a31f2fd9
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
98 additions
and
99 deletions
+98
-99
ddraw.c
dlls/ddraw/ddraw.c
+3
-96
ddraw_private.h
dlls/ddraw/ddraw_private.h
+0
-3
device.c
dlls/wined3d/device.c
+87
-0
wined3d_private.h
dlls/wined3d/wined3d_private.h
+4
-0
wined3d_interface.h
include/wine/wined3d_interface.h
+4
-0
No files found.
dlls/ddraw/ddraw.c
View file @
61125221
...
...
@@ -301,99 +301,6 @@ IDirectDrawImpl_Release(IDirectDraw7 *iface)
*****************************************************************************/
/*****************************************************************************
* IDirectDrawImpl_SetupExclusiveWindow
*
* Helper function that modifies a HWND's Style and ExStyle for proper
* fullscreen use.
*
* Params:
* This: Pointer to the DirectDraw implementation
* HWND: Window to setup
*
*****************************************************************************/
static
void
IDirectDrawImpl_SetupFullscreenWindow
(
IDirectDrawImpl
*
This
,
HWND
window
)
{
LONG
style
,
exStyle
;
/* Don't do anything if an original style is stored.
* That shouldn't happen
*/
TRACE
(
"(%p): Setting up window %p for exclusive mode
\n
"
,
This
,
window
);
if
(
(
This
->
style
!=
0
)
&&
(
This
->
exStyle
!=
0
)
)
{
ERR
(
"(%p) Want to change the window parameters of HWND %p, but "
"another style is stored for restauration afterwards
\n
"
,
This
,
window
);
}
/* Get the parameters and save them */
style
=
GetWindowLongW
(
window
,
GWL_STYLE
);
exStyle
=
GetWindowLongW
(
window
,
GWL_EXSTYLE
);
This
->
style
=
style
;
This
->
exStyle
=
exStyle
;
/* Filter out window decorations */
style
&=
~
WS_CAPTION
;
style
&=
~
WS_THICKFRAME
;
exStyle
&=
~
WS_EX_WINDOWEDGE
;
exStyle
&=
~
WS_EX_CLIENTEDGE
;
/* Make sure the window is managed, otherwise we won't get keyboard input */
style
|=
WS_POPUP
|
WS_SYSMENU
;
TRACE
(
"Old style was %08x,%08x, setting to %08x,%08x
\n
"
,
This
->
style
,
This
->
exStyle
,
style
,
exStyle
);
SetWindowLongW
(
window
,
GWL_STYLE
,
style
);
SetWindowLongW
(
window
,
GWL_EXSTYLE
,
exStyle
);
/* Inform the window about the update.
* TODO: Should I move it to 0/0 too?
*/
SetWindowPos
(
window
,
0
/* InsertAfter, ignored */
,
0
,
0
,
0
,
0
,
/* Pos, Size, ignored */
SWP_FRAMECHANGED
|
SWP_NOSIZE
|
SWP_NOMOVE
|
SWP_NOZORDER
);
}
/*****************************************************************************
* IDirectDrawImpl_RestoreWindow
*
* Helper function that restores a windows' properties when taking it out
* of fullscreen mode
*
* Params:
* This: Pointer to the DirectDraw implementation
* HWND: Window to setup
*
*****************************************************************************/
static
void
IDirectDrawImpl_RestoreWindow
(
IDirectDrawImpl
*
This
,
HWND
window
)
{
if
(
(
This
->
style
==
0
)
&&
(
This
->
exStyle
==
0
)
)
{
/* This could be a DDSCL_NORMAL -> DDSCL_NORMAL
* switch, do nothing
*/
return
;
}
TRACE
(
"(%p): Restoring window settings of window %p to %08x, %08x
\n
"
,
This
,
window
,
This
->
style
,
This
->
exStyle
);
SetWindowLongW
(
window
,
GWL_STYLE
,
This
->
style
);
SetWindowLongW
(
window
,
GWL_EXSTYLE
,
This
->
exStyle
);
/* Delete the old values */
This
->
style
=
0
;
This
->
exStyle
=
0
;
/* Inform the window about the update */
SetWindowPos
(
window
,
0
/* InsertAfter, ignored */
,
0
,
0
,
0
,
0
,
/* Pos, Size, ignored */
SWP_FRAMECHANGED
|
SWP_NOMOVE
|
SWP_NOSIZE
|
SWP_NOZORDER
);
}
/*****************************************************************************
* IDirectDraw7::SetCooperativeLevel
*
* Sets the cooperative level for the DirectDraw object, and the window
...
...
@@ -520,7 +427,7 @@ IDirectDrawImpl_SetCooperativeLevel(IDirectDraw7 *iface,
IDirectDraw7_RestoreDisplayMode
(
iface
);
if
(
window
)
I
DirectDrawImpl_RestoreWindow
(
This
,
window
);
I
WineD3DDevice_RestoreWindow
(
This
->
wineD3DDevice
,
window
);
This
->
cooperative_level
&=
~
DDSCL_FULLSCREEN
;
This
->
cooperative_level
&=
~
DDSCL_EXCLUSIVE
;
...
...
@@ -573,8 +480,8 @@ IDirectDrawImpl_SetCooperativeLevel(IDirectDraw7 *iface,
if
(
window
!=
hwnd
)
{
if
(
window
)
I
DirectDrawImpl_RestoreWindow
(
This
,
window
);
I
DirectDrawImpl_SetupFullscreenWindow
(
This
,
hwnd
);
I
WineD3DDevice_RestoreWindow
(
This
->
wineD3DDevice
,
window
);
I
WineD3DDevice_SetupFullscreenWindow
(
This
->
wineD3DDevice
,
hwnd
);
}
IWineD3DDevice_SetHWND
(
This
->
wineD3DDevice
,
hwnd
);
}
...
...
dlls/ddraw/ddraw_private.h
View file @
61125221
...
...
@@ -120,9 +120,6 @@ struct IDirectDrawImpl
DDCAPS
caps
;
LONG
style
;
LONG
exStyle
;
/* D3D things */
IDirectDrawSurfaceImpl
*
d3d_target
;
HWND
d3d_window
;
...
...
dlls/wined3d/device.c
View file @
61125221
...
...
@@ -1252,6 +1252,91 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateQuery(IWineD3DDevice *iface, WINE
return
WINED3D_OK
;
}
/*****************************************************************************
* IWineD3DDeviceImpl_SetupFullscreenWindow
*
* Helper function that modifies a HWND's Style and ExStyle for proper
* fullscreen use.
*
* Params:
* iface: Pointer to the IWineD3DDevice interface
* window: Window to setup
*
*****************************************************************************/
static
void
WINAPI
IWineD3DDeviceImpl_SetupFullscreenWindow
(
IWineD3DDevice
*
iface
,
HWND
window
)
{
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
LONG
style
,
exStyle
;
/* Don't do anything if an original style is stored.
* That shouldn't happen
*/
TRACE
(
"(%p): Setting up window %p for exclusive mode
\n
"
,
This
,
window
);
if
(
This
->
style
&&
This
->
exStyle
)
{
ERR
(
"(%p): Want to change the window parameters of HWND %p, but "
"another style is stored for restoration afterwards
\n
"
,
This
,
window
);
}
/* Get the parameters and save them */
style
=
GetWindowLongW
(
window
,
GWL_STYLE
);
exStyle
=
GetWindowLongW
(
window
,
GWL_EXSTYLE
);
This
->
style
=
style
;
This
->
exStyle
=
exStyle
;
/* Filter out window decorations */
style
&=
~
WS_CAPTION
;
style
&=
~
WS_THICKFRAME
;
exStyle
&=
~
WS_EX_WINDOWEDGE
;
exStyle
&=
~
WS_EX_CLIENTEDGE
;
/* Make sure the window is managed, otherwise we won't get keyboard input */
style
|=
WS_POPUP
|
WS_SYSMENU
;
TRACE
(
"Old style was %08x,%08x, setting to %08x,%08x
\n
"
,
This
->
style
,
This
->
exStyle
,
style
,
exStyle
);
SetWindowLongW
(
window
,
GWL_STYLE
,
style
);
SetWindowLongW
(
window
,
GWL_EXSTYLE
,
exStyle
);
/* Inform the window about the update. */
SetWindowPos
(
window
,
HWND_TOP
,
0
,
0
,
This
->
ddraw_width
,
This
->
ddraw_height
,
SWP_FRAMECHANGED
);
}
/*****************************************************************************
* IWineD3DDeviceImpl_RestoreWindow
*
* Helper function that restores a windows' properties when taking it out
* of fullscreen mode
*
* Params:
* iface: Pointer to the IWineD3DDevice interface
* window: Window to setup
*
*****************************************************************************/
static
void
WINAPI
IWineD3DDeviceImpl_RestoreWindow
(
IWineD3DDevice
*
iface
,
HWND
window
)
{
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
/* This could be a DDSCL_NORMAL -> DDSCL_NORMAL
* switch, do nothing
*/
if
(
!
This
->
style
&&
!
This
->
exStyle
)
return
;
TRACE
(
"(%p): Restoring window settings of window %p to %08x, %08x
\n
"
,
This
,
window
,
This
->
style
,
This
->
exStyle
);
SetWindowLongW
(
window
,
GWL_STYLE
,
This
->
style
);
SetWindowLongW
(
window
,
GWL_EXSTYLE
,
This
->
exStyle
);
/* Delete the old values */
This
->
style
=
0
;
This
->
exStyle
=
0
;
/* Inform the window about the update */
SetWindowPos
(
window
,
0
/* InsertAfter, ignored */
,
0
,
0
,
0
,
0
,
/* Pos, Size, ignored */
SWP_FRAMECHANGED
|
SWP_NOMOVE
|
SWP_NOSIZE
|
SWP_NOZORDER
);
}
/* example at http://www.fairyengine.com/articles/dxmultiviews.htm */
static
HRESULT
WINAPI
IWineD3DDeviceImpl_CreateAdditionalSwapChain
(
IWineD3DDevice
*
iface
,
WINED3DPRESENT_PARAMETERS
*
pPresentationParameters
,
IWineD3DSwapChain
**
ppSwapChain
,
IUnknown
*
parent
,
...
...
@@ -6759,6 +6844,8 @@ const IWineD3DDeviceVtbl IWineD3DDevice_Vtbl =
IWineD3DDeviceImpl_UpdateSurface
,
IWineD3DDeviceImpl_GetRenderTargetData
,
IWineD3DDeviceImpl_GetFrontBufferData
,
IWineD3DDeviceImpl_SetupFullscreenWindow
,
IWineD3DDeviceImpl_RestoreWindow
,
/*** object tracking ***/
IWineD3DDeviceImpl_ResourceReleased
};
...
...
dlls/wined3d/wined3d_private.h
View file @
61125221
...
...
@@ -560,6 +560,10 @@ typedef struct IWineD3DDeviceImpl
IUnknown
*
parent
;
IWineD3D
*
wineD3D
;
/* Window styles to restore when switching fullscreen mode */
LONG
style
;
LONG
exStyle
;
/* X and GL Information */
GLint
maxConcurrentLights
;
...
...
include/wine/wined3d_interface.h
View file @
61125221
...
...
@@ -471,6 +471,8 @@ DECLARE_INTERFACE_(IWineD3DDevice,IWineD3DBase)
STDMETHOD
(
UpdateSurface
)(
THIS_
struct
IWineD3DSurface
*
pSourceSurface
,
CONST
RECT
*
pSourceRect
,
struct
IWineD3DSurface
*
pDestinationSurface
,
CONST
POINT
*
pDestPoint
)
PURE
;
STDMETHOD
(
GetRenderTargetData
)(
THIS_
struct
IWineD3DSurface
*
pRenderTarget
,
struct
IWineD3DSurface
*
pSurface
)
PURE
;
STDMETHOD
(
GetFrontBufferData
)(
THIS_
UINT
iSwapChain
,
struct
IWineD3DSurface
*
pSurface
)
PURE
;
STDMETHOD_
(
void
,
SetupFullscreenWindow
)(
THIS_
HWND
window
)
PURE
;
STDMETHOD_
(
void
,
RestoreWindow
)(
THIS_
HWND
window
)
PURE
;
/*** object tracking ***/
STDMETHOD_
(
void
,
ResourceReleased
)(
THIS_
struct
IWineD3DResource
*
resource
);
};
...
...
@@ -609,6 +611,8 @@ DECLARE_INTERFACE_(IWineD3DDevice,IWineD3DBase)
#define IWineD3DDevice_UpdateSurface(p,a,b,c,d) (p)->lpVtbl->UpdateSurface(p,a,b,c,d)
#define IWineD3DDevice_GetRenderTargetData(p,a,b) (p)->lpVtbl->GetRenderTargetData(p,a,b)
#define IWineD3DDevice_GetFrontBufferData(p,a,b) (p)->lpVtbl->GetFrontBufferData(p,a,b)
#define IWineD3DDevice_SetupFullscreenWindow(p, a) (p)->lpVtbl->SetupFullscreenWindow(p,a);
#define IWineD3DDevice_RestoreWindow(p, a) (p)->lpVtbl->RestoreWindow(p,a);
#define IWineD3DDevice_ResourceReleased(p,a) (p)->lpVtbl->ResourceReleased(p,a)
#endif
...
...
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