Exemplo n.º 1
0
        protected static GLua LinkVM(IntPtr vm, GLua glua)
        {
            lock (glua)
            lock (_instances)
            {
                // Clean up
                _instances.RemoveAll(kv => kv.Key == vm);

                // link it
                _instances.Add(new KeyValuePair<IntPtr, GLua>(vm, glua));

                return glua;
            }
        }
Exemplo n.º 2
0
        public static GLua New()
        {
            lock (_instances)
            {
                var vm = Lua.luaL_newstate();

                // Get a new glua instance
                var glua = new GLua(vm);

                return LinkVM(vm, glua);
            }
        }