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
b77ac326
Commit
b77ac326
authored
Oct 07, 2006
by
Roderick Colenbrander
Committed by
Alexandre Julliard
Oct 12, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
opengl: Fix wglMakeCurrent bug.
parent
55e3ecf6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
2 deletions
+29
-2
opengl.c
dlls/gdi/opengl.c
+29
-2
No files found.
dlls/gdi/opengl.c
View file @
b77ac326
...
...
@@ -37,6 +37,22 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
wgl
);
static
HDC
default_hdc
=
0
;
/* We route all wgl functions from opengl32.dll through gdi32.dll to
* the display driver. Various wgl calls have a hDC as one of their parameters.
* Using DC_GetDCPtr we get access to the functions exported by the driver.
* Some functions don't receive a hDC. This function creates a global hdc and
* if there's already a global hdc, it returns it.
*/
static
DC
*
OPENGL_GetDefaultDC
()
{
if
(
!
default_hdc
)
default_hdc
=
CreateDCA
(
"DISPLAY"
,
NULL
,
NULL
,
NULL
);
return
DC_GetDCPtr
(
default_hdc
);
}
/***********************************************************************
* wglCreateContext (OPENGL32.@)
*/
...
...
@@ -62,7 +78,14 @@ HGLRC WINAPI wglCreateContext(HDC hdc)
BOOL
WINAPI
wglMakeCurrent
(
HDC
hdc
,
HGLRC
hglrc
)
{
BOOL
ret
=
FALSE
;
DC
*
dc
=
DC_GetDCPtr
(
hdc
);
DC
*
dc
=
NULL
;
/* When the context hglrc is NULL, the HDC is ignored and can be NULL.
* In that case use the global hDC to get access to the driver. */
if
(
hglrc
==
NULL
)
dc
=
OPENGL_GetDefaultDC
();
else
dc
=
DC_GetDCPtr
(
hdc
);
TRACE
(
"hdc: (%p), hglrc: (%p)
\n
"
,
hdc
,
hglrc
);
...
...
@@ -71,7 +94,11 @@ BOOL WINAPI wglMakeCurrent(HDC hdc, HGLRC hglrc)
if
(
!
dc
->
funcs
->
pwglMakeCurrent
)
FIXME
(
" :stub
\n
"
);
else
ret
=
dc
->
funcs
->
pwglMakeCurrent
(
dc
->
physDev
,
hglrc
);
GDI_ReleaseObj
(
hdc
);
if
(
hglrc
==
NULL
)
GDI_ReleaseObj
(
default_hdc
);
else
GDI_ReleaseObj
(
hdc
);
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