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
5923e32e
Commit
5923e32e
authored
Jul 25, 2012
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
opengl32: Store the modified extension string in the context.
parent
5f157e18
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
33 deletions
+42
-33
wgl.c
dlls/opengl32/wgl.c
+42
-33
No files found.
dlls/opengl32/wgl.c
View file @
5923e32e
...
...
@@ -67,10 +67,11 @@ enum wgl_handle_type
struct
opengl_context
{
DWORD
tid
;
/* thread that the context is current in */
HDC
draw_dc
;
/* current drawing DC */
HDC
read_dc
;
/* current reading DC */
struct
wgl_context
*
drv_ctx
;
/* driver context */
DWORD
tid
;
/* thread that the context is current in */
HDC
draw_dc
;
/* current drawing DC */
HDC
read_dc
;
/* current reading DC */
GLubyte
*
extensions
;
/* extension string */
struct
wgl_context
*
drv_ctx
;
/* driver context */
};
struct
wgl_handle
...
...
@@ -215,6 +216,7 @@ BOOL WINAPI wglDeleteContext(HGLRC hglrc)
}
if
(
hglrc
==
NtCurrentTeb
()
->
glCurrentRC
)
wglMakeCurrent
(
0
,
0
);
ptr
->
funcs
->
wgl
.
p_wglDeleteContext
(
ptr
->
u
.
context
->
drv_ctx
);
HeapFree
(
GetProcessHeap
(),
0
,
ptr
->
u
.
context
->
extensions
);
HeapFree
(
GetProcessHeap
(),
0
,
ptr
->
u
.
context
);
free_handle_ptr
(
ptr
);
return
TRUE
;
...
...
@@ -1480,26 +1482,41 @@ GLint WINAPI wine_glDebugEntry( GLint unknown1, GLint unknown2 )
}
/* build the extension string by filtering out the disabled extensions */
static
char
*
build_gl
_extensions
(
const
char
*
extensions
)
static
GLubyte
*
filter
_extensions
(
const
char
*
extensions
)
{
char
*
p
,
*
str
,
*
disabled
=
NULL
;
static
const
char
*
disabled
;
char
*
p
,
*
str
;
const
char
*
end
;
HKEY
hkey
;
TRACE
(
"GL_EXTENSIONS:
\n
"
);
if
(
!
extensions
)
extensions
=
""
;
/* @@ Wine registry key: HKCU\Software\Wine\OpenGL */
if
(
!
RegOpenKeyA
(
HKEY_CURRENT_USER
,
"Software
\\
Wine
\\
OpenGL"
,
&
hkey
))
if
(
!
disabled
)
{
DWORD
size
,
ret
=
RegQueryValueExA
(
hkey
,
"DisabledExtensions"
,
0
,
NULL
,
NULL
,
&
size
);
if
(
!
ret
&&
(
disabled
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
)))
ret
=
RegQueryValueExA
(
hkey
,
"DisabledExtensions"
,
0
,
NULL
,
(
BYTE
*
)
disabled
,
&
size
);
RegCloseKey
(
hkey
);
if
(
ret
)
*
disabled
=
0
;
HKEY
hkey
;
DWORD
size
;
str
=
NULL
;
/* @@ Wine registry key: HKCU\Software\Wine\OpenGL */
if
(
!
RegOpenKeyA
(
HKEY_CURRENT_USER
,
"Software
\\
Wine
\\
OpenGL"
,
&
hkey
))
{
if
(
!
RegQueryValueExA
(
hkey
,
"DisabledExtensions"
,
0
,
NULL
,
NULL
,
&
size
))
{
str
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
if
(
RegQueryValueExA
(
hkey
,
"DisabledExtensions"
,
0
,
NULL
,
(
BYTE
*
)
str
,
&
size
))
*
str
=
0
;
}
RegCloseKey
(
hkey
);
}
if
(
str
)
{
if
(
InterlockedCompareExchangePointer
(
(
void
**
)
&
disabled
,
str
,
NULL
))
HeapFree
(
GetProcessHeap
(),
0
,
str
);
}
else
disabled
=
""
;
}
if
(
!
disabled
[
0
])
return
NULL
;
if
((
str
=
HeapAlloc
(
GetProcessHeap
(),
0
,
strlen
(
extensions
)
+
2
)))
{
p
=
str
;
...
...
@@ -1521,8 +1538,7 @@ static char *build_gl_extensions( const char *extensions )
}
*
p
=
0
;
}
HeapFree
(
GetProcessHeap
(),
0
,
disabled
);
return
str
;
return
(
GLubyte
*
)
str
;
}
/***********************************************************************
...
...
@@ -1530,24 +1546,17 @@ static char *build_gl_extensions( const char *extensions )
*/
const
GLubyte
*
WINAPI
wine_glGetString
(
GLenum
name
)
{
const
struct
opengl_funcs
*
funcs
=
NtCurrentTeb
()
->
glTable
;
static
const
GLubyte
*
gl_extensions
;
/* this is for buggy nvidia driver, crashing if called from a different
thread with no context */
if
(
wglGetCurrentContext
()
==
NULL
)
return
NULL
;
if
(
name
!=
GL_EXTENSIONS
)
return
funcs
->
gl
.
p_glGetString
(
name
);
const
struct
opengl_funcs
*
funcs
=
NtCurrentTeb
()
->
glTable
;
const
GLubyte
*
ret
=
funcs
->
gl
.
p_glGetString
(
name
);
if
(
!
gl_extensions
)
{
const
char
*
orig_ext
=
(
const
char
*
)
funcs
->
gl
.
p_glGetString
(
GL_EXTENSIONS
);
char
*
new_ext
=
build_gl_extensions
(
orig_ext
);
if
(
InterlockedCompareExchangePointer
(
(
void
**
)
&
gl_extensions
,
new_ext
,
NULL
))
HeapFree
(
GetProcessHeap
(),
0
,
new_ext
)
;
}
return
gl_extensions
;
if
(
name
==
GL_EXTENSIONS
&&
ret
)
{
struct
wgl_handle
*
ptr
=
get_current_context_ptr
(
);
if
(
ptr
->
u
.
context
->
extensions
||
((
ptr
->
u
.
context
->
extensions
=
filter_extensions
(
(
const
char
*
)
ret
))
))
ret
=
ptr
->
u
.
context
->
extensions
;
}
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