コード例 #1
0
ファイル: CubemapTexture.cs プロジェクト: Pctg-x8/Altseed
 public void Destroy()
 {
     lock (this)
     {
         if (SwigObject == null) return;
         GC.Collector.AddObject(SwigObject);
         SwigObject = null;
     }
     Particular.GC.SuppressFinalize(this);
 }
コード例 #2
0
        internal CubemapTexture(swig.CubemapTexture swig)
        {
#if DEBUG
            // 唯一の対応するクラスであることを保証
            if (GC.CubemapTextures.GetObject(swig.GetPtr()) != null)
            {
                throw new Exception();
            }
#endif
            SwigObject = swig;
        }
コード例 #3
0
ファイル: CubemapTexture.cs プロジェクト: neofuji/Altseed
        internal CubemapTexture(swig.CubemapTexture swig)
        {
#if DEBUG
            // 唯一の対応するクラスであることを保証
            if (GC.CubemapTextures.GetObject(swig.GetPtr()) != null)
            {
                Particular.Helper.ThrowException("");
            }
#endif
            SwigObject = swig;
        }
コード例 #4
0
ファイル: CubemapTexture.cs プロジェクト: wraikny/Altseed
        internal CubemapTexture(swig.CubemapTexture coreInstance)
        {
#if DEBUG
            // 唯一の対応するクラスであることを保証
            if (GC.CubemapTextures.Contains(coreInstance.GetPtr()))
            {
                Particular.Helper.ThrowException("");
            }
#endif
            CoreInstance = coreInstance;
        }
コード例 #5
0
        /// <summary>
        /// ネイティブのインスタンスからラッパー側のインスタンスを生成する。
        /// </summary>
        /// <param name="o"></param>
        /// <param name="type"></param>
        internal static CubemapTexture GenerateCubemapTexture(swig.CubemapTexture o, GenerationType type)
        {
            var p = o.GetPtr();

            var existing = GC.CubemapTextures.GetObject(p);

            existing = GenerateInternal(existing, o, type);
            if (existing != null)
            {
                return(existing);
            }

            var ret = new CubemapTexture(o);

            GC.CubemapTextures.AddObject(p, ret);
            return(ret);
        }