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
a3c12c5b
Commit
a3c12c5b
authored
Apr 12, 2011
by
Matteo Bruni
Committed by
Alexandre Julliard
Apr 20, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Fallback to our private window when context activation fails otherwise.
parent
edebabc2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
2 deletions
+60
-2
context.c
dlls/wined3d/context.c
+49
-2
swapchain.c
dlls/wined3d/swapchain.c
+8
-0
wined3d_private.h
dlls/wined3d/wined3d_private.h
+3
-0
No files found.
dlls/wined3d/context.c
View file @
a3c12c5b
...
...
@@ -795,15 +795,62 @@ static BOOL context_set_pixel_format(const struct wined3d_gl_info *gl_info, HDC
static
BOOL
context_set_gl_context
(
struct
wined3d_context
*
ctx
)
{
struct
wined3d_swapchain
*
swapchain
=
ctx
->
swapchain
;
if
(
!
pwglMakeCurrent
(
ctx
->
hdc
,
ctx
->
glCtx
))
{
WARN
(
"Failed to make GL context %p current on device context %p, last error %#x.
\n
"
,
ctx
->
glCtx
,
ctx
->
hdc
,
GetLastError
());
ctx
->
valid
=
0
;
context_set_current
(
NULL
);
return
FALSE
;
WARN
(
"Trying fallback to the backup window.
\n
"
);
if
(
!
swapchain
->
backup_dc
)
{
TRACE
(
"Creating the backup window for swapchain %p.
\n
"
,
swapchain
);
swapchain
->
backup_wnd
=
CreateWindowA
(
WINED3D_OPENGL_WINDOW_CLASS_NAME
,
"WineD3D fake window"
,
WS_OVERLAPPEDWINDOW
,
10
,
10
,
10
,
10
,
NULL
,
NULL
,
NULL
,
NULL
);
if
(
!
swapchain
->
backup_wnd
)
{
ERR
(
"Failed to create a window.
\n
"
);
goto
fail
;
}
swapchain
->
backup_dc
=
GetDC
(
swapchain
->
backup_wnd
);
if
(
!
swapchain
->
backup_dc
)
{
ERR
(
"Failed to get a DC.
\n
"
);
goto
fail
;
}
if
(
!
context_set_pixel_format
(
ctx
->
gl_info
,
swapchain
->
backup_dc
,
ctx
->
pixel_format
))
{
ERR
(
"Failed to set pixel format %d on device context %p.
\n
"
,
ctx
->
pixel_format
,
swapchain
->
backup_dc
);
goto
fail
;
}
}
if
(
!
pwglMakeCurrent
(
swapchain
->
backup_dc
,
ctx
->
glCtx
))
{
ERR
(
"Fallback to backup window (dc %p) failed too, last error %#x.
\n
"
,
swapchain
->
backup_dc
,
GetLastError
());
context_set_current
(
NULL
);
return
FALSE
;
}
}
return
TRUE
;
fail:
if
(
swapchain
->
backup_dc
)
{
ReleaseDC
(
swapchain
->
backup_wnd
,
swapchain
->
backup_dc
);
swapchain
->
backup_dc
=
NULL
;
}
if
(
swapchain
->
backup_wnd
)
{
DestroyWindow
(
swapchain
->
backup_wnd
);
swapchain
->
backup_wnd
=
NULL
;
}
context_set_current
(
NULL
);
return
FALSE
;
}
static
void
context_restore_gl_context
(
HDC
dc
,
HGLRC
gl_ctx
)
...
...
dlls/wined3d/swapchain.c
View file @
a3c12c5b
...
...
@@ -80,6 +80,14 @@ static void swapchain_cleanup(struct wined3d_swapchain *swapchain)
mode
.
Format
=
swapchain
->
orig_fmt
;
IWineD3DDevice_SetDisplayMode
((
IWineD3DDevice
*
)
swapchain
->
device
,
0
,
&
mode
);
}
if
(
swapchain
->
backup_dc
)
{
TRACE
(
"Destroying backup wined3d window %p, dc %p.
\n
"
,
swapchain
->
backup_wnd
,
swapchain
->
backup_dc
);
ReleaseDC
(
swapchain
->
backup_wnd
,
swapchain
->
backup_dc
);
DestroyWindow
(
swapchain
->
backup_wnd
);
}
}
ULONG
CDECL
wined3d_swapchain_incref
(
struct
wined3d_swapchain
*
swapchain
)
...
...
dlls/wined3d/wined3d_private.h
View file @
a3c12c5b
...
...
@@ -2543,6 +2543,9 @@ struct wined3d_swapchain
HWND
win_handle
;
HWND
device_window
;
HDC
backup_dc
;
HWND
backup_wnd
;
};
void
x11_copy_to_screen
(
struct
wined3d_swapchain
*
swapchain
,
const
RECT
*
rect
)
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