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
11013af0
Commit
11013af0
authored
Sep 07, 2012
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Get the current pixel format from the drawable structure in wglMakeCurrent.
parent
d52c2de7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
33 deletions
+24
-33
opengl.c
dlls/winex11.drv/opengl.c
+24
-33
No files found.
dlls/winex11.drv/opengl.c
View file @
11013af0
...
...
@@ -1662,8 +1662,9 @@ static PROC glxdrv_wglGetProcAddress(LPCSTR lpszProc)
*/
static
BOOL
glxdrv_wglMakeCurrent
(
HDC
hdc
,
struct
wgl_context
*
ctx
)
{
BOOL
ret
;
struct
x11drv_escape_get_drawable
escape
;
BOOL
ret
=
FALSE
;
HWND
hwnd
;
struct
gl_drawable
*
gl
;
TRACE
(
"(%p,%p)
\n
"
,
hdc
,
ctx
);
...
...
@@ -1674,51 +1675,41 @@ static BOOL glxdrv_wglMakeCurrent(HDC hdc, struct wgl_context *ctx)
return
TRUE
;
}
escape
.
code
=
X11DRV_GET_DRAWABLE
;
if
(
!
ExtEscape
(
hdc
,
X11DRV_ESCAPE
,
sizeof
(
escape
.
code
),
(
LPCSTR
)
&
escape
.
code
,
sizeof
(
escape
),
(
LPSTR
)
&
escape
))
return
FALSE
;
hwnd
=
WindowFromDC
(
hdc
);
EnterCriticalSection
(
&
context_section
);
if
(
!
escape
.
pixel_format
)
{
WARN
(
"Trying to use an invalid drawable
\n
"
);
SetLastError
(
ERROR_INVALID_HANDLE
);
return
FALSE
;
}
if
(
ctx
->
fmt
-
pixel_formats
!=
escape
.
pixel_format
-
1
)
{
WARN
(
"mismatched pixel format hdc %p %u ctx %p
\n
"
,
hdc
,
escape
.
pixel_format
,
ctx
);
SetLastError
(
ERROR_INVALID_PIXEL_FORMAT
);
return
FALSE
;
}
else
if
(
!
XFindContext
(
gdi_display
,
(
XID
)
hwnd
,
gl_hwnd_context
,
(
char
**
)
&
gl
)
||
!
XFindContext
(
gdi_display
,
(
XID
)
hdc
,
gl_pbuffer_context
,
(
char
**
)
&
gl
))
{
if
(
ctx
->
fmt
!=
gl
->
format
)
{
WARN
(
"mismatched pixel format hdc %p %p ctx %p %p
\n
"
,
hdc
,
gl
->
format
,
ctx
,
ctx
->
fmt
);
SetLastError
(
ERROR_INVALID_PIXEL_FORMAT
);
goto
done
;
}
if
(
TRACE_ON
(
wgl
))
{
int
vis_id
;
pglXGetFBConfigAttrib
(
gdi_display
,
ctx
->
fmt
->
fbconfig
,
GLX_VISUAL_ID
,
&
vis_id
);
describeContext
(
ctx
);
TRACE
(
"hdc %p drawable %lx fmt %u vis %x ctx %p
\n
"
,
hdc
,
escape
.
gl_drawable
,
escape
.
pixel_format
,
vis_id
,
ctx
->
ctx
);
TRACE
(
"hdc %p drawable %lx fmt %p ctx %p
\n
"
,
hdc
,
gl
->
drawable
,
gl
->
format
,
ctx
->
ctx
);
}
ret
=
pglXMakeCurrent
(
gdi_display
,
escape
.
gl_drawable
,
ctx
->
ctx
);
ret
=
pglXMakeCurrent
(
gdi_display
,
gl
->
drawable
,
ctx
->
ctx
);
if
(
ret
)
{
NtCurrentTeb
()
->
glContext
=
ctx
;
EnterCriticalSection
(
&
context_section
);
ctx
->
has_been_current
=
TRUE
;
ctx
->
hdc
=
hdc
;
ctx
->
drawables
[
0
]
=
escape
.
gl_
drawable
;
ctx
->
drawables
[
1
]
=
escape
.
gl_
drawable
;
ctx
->
drawables
[
0
]
=
gl
->
drawable
;
ctx
->
drawables
[
1
]
=
gl
->
drawable
;
ctx
->
refresh_drawables
=
FALSE
;
LeaveCriticalSection
(
&
context_section
)
;
goto
done
;
}
else
SetLastError
(
ERROR_INVALID_HANDLE
);
}
TRACE
(
" returning %s
\n
"
,
(
ret
?
"True"
:
"False"
));
SetLastError
(
ERROR_INVALID_HANDLE
);
done:
LeaveCriticalSection
(
&
context_section
);
TRACE
(
"%p,%p returning %d
\n
"
,
hdc
,
ctx
,
ret
);
return
ret
;
}
...
...
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