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
ef689083
Commit
ef689083
authored
Apr 13, 2016
by
Jacek Caban
Committed by
Alexandre Julliard
Apr 14, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11.drv: Use InitOnceExecuteOnce in has_opengl.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5f522029
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
opengl.c
dlls/winex11.drv/opengl.c
+12
-9
No files found.
dlls/winex11.drv/opengl.c
View file @
ef689083
...
...
@@ -573,18 +573,14 @@ done:
return
ret
;
}
static
BOOL
has_opengl
(
void
)
{
static
BOOL
init_done
=
FALSE
;
static
void
*
opengl_handle
;
static
void
*
opengl_handle
;
static
BOOL
WINAPI
init_opengl
(
INIT_ONCE
*
once
,
void
*
param
,
void
**
context
)
{
char
buffer
[
200
];
int
error_base
,
event_base
;
unsigned
int
i
;
if
(
init_done
)
return
(
opengl_handle
!=
NULL
);
init_done
=
TRUE
;
/* No need to load any other libraries as according to the ABI, libGL should be self-sufficient
and include all dependencies */
opengl_handle
=
wine_dlopen
(
SONAME_LIBGL
,
RTLD_NOW
|
RTLD_GLOBAL
,
buffer
,
sizeof
(
buffer
));
...
...
@@ -592,7 +588,7 @@ static BOOL has_opengl(void)
{
ERR
(
"Failed to load libGL: %s
\n
"
,
buffer
);
ERR
(
"OpenGL support is disabled.
\n
"
);
return
FALS
E
;
return
TRU
E
;
}
for
(
i
=
0
;
i
<
sizeof
(
opengl_func_names
)
/
sizeof
(
opengl_func_names
[
0
]);
i
++
)
...
...
@@ -757,7 +753,14 @@ static BOOL has_opengl(void)
failed:
wine_dlclose
(
opengl_handle
,
NULL
,
0
);
opengl_handle
=
NULL
;
return
FALSE
;
return
TRUE
;
}
static
BOOL
has_opengl
(
void
)
{
static
INIT_ONCE
init_once
=
INIT_ONCE_STATIC_INIT
;
InitOnceExecuteOnce
(
&
init_once
,
init_opengl
,
NULL
,
NULL
);
return
opengl_handle
!=
NULL
;
}
static
const
char
*
debugstr_fbconfig
(
GLXFBConfig
fbconfig
)
...
...
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