aboutsummaryrefslogtreecommitdiffstats
path: root/lib/wx/src/wxe_master.erl
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2010-10-06 14:05:36 +0200
committerDan Gudmundsson <[email protected]>2010-11-15 10:13:05 +0100
commita9f305c51ebccefc3ce6725b4f90700a7d250287 (patch)
tree64f522982e763eb5eda411196413a15704db36c4 /lib/wx/src/wxe_master.erl
parentb48be79573171e530d97cdf078488eb66fc23f30 (diff)
downloadotp-a9f305c51ebccefc3ce6725b4f90700a7d250287.tar.gz
otp-a9f305c51ebccefc3ce6725b4f90700a7d250287.tar.bz2
otp-a9f305c51ebccefc3ce6725b4f90700a7d250287.zip
Split opengl functionality into separate dynamic library
The idea is to build a separate opengl library which can be reused by other erlang applications.
Diffstat (limited to 'lib/wx/src/wxe_master.erl')
-rw-r--r--lib/wx/src/wxe_master.erl21
1 files changed, 20 insertions, 1 deletions
diff --git a/lib/wx/src/wxe_master.erl b/lib/wx/src/wxe_master.erl
index 5ab76a77cf..bd9511e94d 100644
--- a/lib/wx/src/wxe_master.erl
+++ b/lib/wx/src/wxe_master.erl
@@ -28,7 +28,7 @@
-behaviour(gen_server).
%% API
--export([start/0, init_port/0]).
+-export([start/0, init_port/0, init_opengl/0]).
%% gen_server callbacks
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
@@ -38,6 +38,7 @@
users, %% List of wx servers, needed ??
driver}). %% Driver name so wx_server can create it's own port
+-include("wxe.hrl").
-include("gen/wxe_debug.hrl").
-include("gen/gl_debug.hrl").
@@ -74,6 +75,24 @@ init_port() ->
receive wx_port_initiated -> ok end,
{Port, CBport}.
+
+%%--------------------------------------------------------------------
+%% Function: start_link() -> {ok,Pid} | ignore | {error,Error}
+%% Description: Starts the server
+%%--------------------------------------------------------------------
+init_opengl() ->
+ PrivDir = priv_dir(),
+ DynLib0 = "erl_gl",
+ DynLib = case os:type() of
+ {win32,_} ->
+ DynLib0 ++ ".dll\0";
+ _ ->
+ DynLib0 ++ ".so\0"
+ end,
+ GLLib = filename:join(PrivDir, DynLib),
+
+ wxe_util:call(?WXE_INIT_OPENGL, list_to_binary(GLLib)).
+
%%====================================================================
%% gen_server callbacks
%%====================================================================