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
c01d723a
Commit
c01d723a
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 wglCreateContext.
parent
356f9897
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
32 deletions
+16
-32
opengl.c
dlls/winex11.drv/opengl.c
+16
-32
No files found.
dlls/winex11.drv/opengl.c
View file @
c01d723a
...
...
@@ -1608,43 +1608,27 @@ static BOOL glxdrv_wglCopyContext(struct wgl_context *src, struct wgl_context *d
*/
static
struct
wgl_context
*
glxdrv_wglCreateContext
(
HDC
hdc
)
{
struct
x11drv_escape_get_drawable
escape
;
struct
wgl_context
*
ret
;
const
struct
wgl_pixel_format
*
fmt
;
TRACE
(
"(%p)
\n
"
,
hdc
);
struct
wgl_context
*
ret
=
NULL
;
struct
gl_drawable
*
gl
;
HWND
hwnd
=
WindowFromDC
(
hdc
);
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
);
fmt
=
get_pixel_format
(
gdi_display
,
escape
.
pixel_format
,
TRUE
/* Offscreen */
);
/* We can render using the iPixelFormat (1) of Wine's Main visual AND using some offscreen formats.
* Note that standard WGL-calls don't recognize offscreen-only formats. For that reason pbuffers
* use a sort of 'proxy' HDC (wglGetPbufferDCARB).
* If this fails something is very wrong on the system. */
if
(
!
fmt
)
{
ERR
(
"Cannot get FB Config for iPixelFormat %d, expect problems!
\n
"
,
escape
.
pixel_format
);
SetLastError
(
ERROR_INVALID_PIXEL_FORMAT
);
return
NULL
;
if
(
!
XFindContext
(
gdi_display
,
(
XID
)
hwnd
,
gl_hwnd_context
,
(
char
**
)
&
gl
)
||
!
XFindContext
(
gdi_display
,
(
XID
)
hdc
,
gl_pbuffer_context
,
(
char
**
)
&
gl
))
{
if
(
!
(
ret
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
ret
))))
goto
done
;
ret
->
hdc
=
hdc
;
ret
->
fmt
=
gl
->
format
;
ret
->
vis
=
pglXGetVisualFromFBConfig
(
gdi_display
,
gl
->
format
->
fbconfig
);
ret
->
ctx
=
create_glxcontext
(
gdi_display
,
ret
,
NULL
);
list_add_head
(
&
context_list
,
&
ret
->
entry
)
;
}
else
SetLastError
(
ERROR_INVALID_PIXEL_FORMAT
);
if
(
!
(
ret
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
ret
))))
return
0
;
ret
->
hdc
=
hdc
;
ret
->
fmt
=
fmt
;
ret
->
has_been_current
=
FALSE
;
ret
->
sharing
=
FALSE
;
ret
->
vis
=
pglXGetVisualFromFBConfig
(
gdi_display
,
fmt
->
fbconfig
);
ret
->
ctx
=
create_glxcontext
(
gdi_display
,
ret
,
NULL
);
EnterCriticalSection
(
&
context_section
);
list_add_head
(
&
context_list
,
&
ret
->
entry
);
done:
LeaveCriticalSection
(
&
context_section
);
TRACE
(
" creating context %p (GL context creation delayed)
\n
"
,
ret
);
TRACE
(
"%p -> %p
\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