aboutsummaryrefslogtreecommitdiffstats
path: root/lib/wx/src/wxe_master.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/wx/src/wxe_master.erl')
-rw-r--r--lib/wx/src/wxe_master.erl12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/wx/src/wxe_master.erl b/lib/wx/src/wxe_master.erl
index e17a3327ac..ce859b3eb3 100644
--- a/lib/wx/src/wxe_master.erl
+++ b/lib/wx/src/wxe_master.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -82,8 +82,14 @@ init_port(SilentStart) ->
%% Initalizes the opengl library
%%--------------------------------------------------------------------
init_opengl() ->
- GLLib = wxe_util:wxgl_dl(),
- wxe_util:call(?WXE_INIT_OPENGL, <<(list_to_binary(GLLib))/binary, 0:8>>).
+ case get(wx_init_opengl) of
+ true -> {ok, "already initialized"};
+ _ ->
+ GLLib = wxe_util:wxgl_dl(),
+ Res = wxe_util:call(?WXE_INIT_OPENGL, <<(list_to_binary(GLLib))/binary, 0:8>>),
+ element(1, Res) =:= ok andalso put(wx_init_opengl, true),
+ Res
+ end.
%%--------------------------------------------------------------------
%% Fetch early messages, hack to get start up args on mac