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
bf5e1b6a
Commit
bf5e1b6a
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 wglGetPixelFormat.
parent
4df8f15f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
17 deletions
+13
-17
opengl.c
dlls/winex11.drv/opengl.c
+13
-17
No files found.
dlls/winex11.drv/opengl.c
View file @
bf5e1b6a
...
...
@@ -1509,26 +1509,22 @@ static int glxdrv_wglDescribePixelFormat( HDC hdc, int iPixelFormat,
*/
static
int
glxdrv_wglGetPixelFormat
(
HDC
hdc
)
{
struct
x11drv_escape_get_drawable
escape
;
TRACE
(
"(%p)
\n
"
,
hdc
)
;
HWND
hwnd
=
WindowFromDC
(
hdc
)
;
struct
gl_drawable
*
gl
;
int
ret
=
0
;
escape
.
code
=
X11DRV_GET_DRAWABLE
;
if
(
!
ExtEscape
(
hdc
,
X11DRV_ESCAPE
,
sizeof
(
escape
.
code
),
(
LPCSTR
)
&
escape
.
code
,
sizeof
(
escape
),
(
LPSTR
)
&
escape
))
return
0
;
EnterCriticalSection
(
&
context_section
);
if
(
!
XFindContext
(
gdi_display
,
(
XID
)
hwnd
,
gl_hwnd_context
,
(
char
**
)
&
gl
)
||
!
XFindContext
(
gdi_display
,
(
XID
)
hdc
,
gl_pbuffer_context
,
(
char
**
)
&
gl
))
ret
=
gl
->
pixel_format
;
LeaveCriticalSection
(
&
context_section
);
if
(
!
is_valid_pixel_format
(
escape
.
pixel_format
))
return
0
;
/* not set yet */
/* Offscreen formats can't be used with traditional WGL calls.
* As has been verified on Windows GetPixelFormat doesn't fail but returns iPixelFormat=1. */
if
(
ret
&&
!
is_onscreen_pixel_format
(
ret
))
ret
=
1
;
if
(
!
is_onscreen_pixel_format
(
escape
.
pixel_format
))
{
/* Offscreen formats can't be used with traditional WGL calls.
* As has been verified on Windows GetPixelFormat doesn't fail but returns iPixelFormat=1. */
TRACE
(
"Returning iPixelFormat=1 for offscreen format: %d
\n
"
,
escape
.
pixel_format
);
return
1
;
}
TRACE
(
"(%p): returns %d
\n
"
,
hdc
,
escape
.
pixel_format
);
return
escape
.
pixel_format
;
TRACE
(
"%p -> %d
\n
"
,
hdc
,
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