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
14abaa57
Commit
14abaa57
authored
Feb 25, 2008
by
Chris Robinson
Committed by
Alexandre Julliard
Feb 26, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Fix wglCopyContext case where GLX contexts are missing.
parent
b83abb61
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
5 deletions
+34
-5
opengl.c
dlls/winex11.drv/opengl.c
+34
-5
No files found.
dlls/winex11.drv/opengl.c
View file @
14abaa57
...
...
@@ -1523,15 +1523,44 @@ BOOL X11DRV_wglCopyContext(HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask) {
* Up to now that works fine.
*
* The delayed GLX context creation could cause issues for wglCopyContext as it might get called
* when there is no GLX context yet.
Warn the user about it and let him report a bug report.
*
The chance this will cause problems is small as at the time of writing Wine has had OpenGL support
*
for more than 7 years and this function has remained a stub
ever since then.
* when there is no GLX context yet.
The chance this will cause problems is small as at the time of
*
writing Wine has had OpenGL support for more than 7 years and this function has remained a stub
* ever since then.
*/
if
(
!
src
->
ctx
||
!
dst
->
ctx
)
{
FIXME
(
"No source or destination context available! This could indicate a Wine bug.
\n
"
);
return
FALSE
;
/* NOTE: As a special case, if both GLX contexts are NULL, that means
* neither WGL context was made current. In that case, both contexts
* are in a default state, so any copy would no-op.
*/
if
(
!
src
->
ctx
&&
!
dst
->
ctx
)
{
TRACE
(
"No source or destination contexts set. No-op.
\n
"
);
return
TRUE
;
}
if
(
!
src
->
ctx
)
{
DWORD
type
=
GetObjectType
(
src
->
hdc
);
wine_tsx11_lock
();
if
(
src
->
vis
)
src
->
ctx
=
pglXCreateContext
(
gdi_display
,
src
->
vis
,
NULL
,
type
==
OBJ_MEMDC
?
False
:
True
);
else
/* Create a GLX Context for a pbuffer */
src
->
ctx
=
pglXCreateNewContext
(
gdi_display
,
src
->
fmt
->
fbconfig
,
src
->
fmt
->
render_type
,
NULL
,
True
);
TRACE
(
" created a delayed OpenGL context (%p)
\n
"
,
src
->
ctx
);
}
else
if
(
!
dst
->
ctx
)
{
DWORD
type
=
GetObjectType
(
dst
->
hdc
);
wine_tsx11_lock
();
if
(
dst
->
vis
)
dst
->
ctx
=
pglXCreateContext
(
gdi_display
,
dst
->
vis
,
NULL
,
type
==
OBJ_MEMDC
?
False
:
True
);
else
/* Create a GLX Context for a pbuffer */
dst
->
ctx
=
pglXCreateNewContext
(
gdi_display
,
dst
->
fmt
->
fbconfig
,
dst
->
fmt
->
render_type
,
NULL
,
True
);
TRACE
(
" created a delayed OpenGL context (%p)
\n
"
,
dst
->
ctx
);
}
}
else
wine_tsx11_lock
();
pglXCopyContext
(
gdi_display
,
src
->
ctx
,
dst
->
ctx
,
mask
);
wine_tsx11_unlock
();
/* As opposed to wglCopyContext, glXCopyContext doesn't return anything, so hopefully we passed */
return
TRUE
;
...
...
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