Beispiel #1
0
    // -- Sprオブジェクトの構築を行う
    public override ObjectIf Build()
    {
        SEH_Exception.init();

        PHSceneIf phScene;

        if (enableDebugWindow)
        {
            fwApp = new FWApp();
            fwApp.InitInNewThread();

            // FWAppの初期化が終わるまで待つ
            while (fwApp.GetSdk() == null || fwApp.GetSdk().GetPHSdk() == null)
            {
                System.Threading.Thread.Sleep(10);
            }

            phSdk   = fwApp.GetSdk().GetPHSdk();
            phScene = fwApp.GetSdk().GetScene(0).GetPHScene();
            phScene.Clear();
            phScene.SetDesc((PHSceneDesc)desc);

            FWSceneIf fwSceneIf = fwApp.GetSdk().GetScene(0);
            fwSceneIf.EnableRenderContact(true);
            fwSceneIf.EnableRenderForce(false, true);
            //fwSceneIf.SetForceScale(0.01f, 0.01f);
        }
        else
        {
            phSdk   = PHSdkIf.CreateSdk();
            phScene = phSdk.CreateScene((PHSceneDesc)desc);
        }

        return(phScene);
    }
Beispiel #2
0
    static void RaiseException(String msg)
    {
        String str = msg + SEH_Exception.what();

        if (callback != null)
        {
            callback();
        }
        throw new System.Exception(str);
    }
Beispiel #3
0
        static void test_func_args()
        {
            test_name("function arguments");

            // 引数をちゃんと設定しないと例外が起きる!!
            if (brk != "y")
            {
                return;
            }

            // default argument
            FWApp     app   = new FWApp();
            FWWinDesc desc  = new FWWinDesc();
            FWWinIf   winif = new FWWinIf();

            try { FWWinIf win1 = app.CreateWin(); }
            catch (System.Exception e) { put(SEH_Exception.what(e)); }
            try { FWWinIf win2 = app.CreateWin(desc); }
            catch (System.Exception e) { put(SEH_Exception.what(e)); }
            try { FWWinIf win3 = app.CreateWin(desc, winif); }
            catch (System.Exception e) { put(SEH_Exception.what(e)); }

            // NULL pointer as argument
            try { FWWinIf win4 = app.CreateWin(desc, null); }
            catch (System.Exception e) { put(SEH_Exception.what(e)); }

            // これ以降のコードは正常には動作はしない - 例外が起きて停止する。
            // デバッガで止めて値を確認すること。
            //
            if (brk != "y")
            {
                return;
            }

            // [int]
            CDShapePairIf shapePairIf = new CDShapePairIf();

            shapePairIf.GetShape(123);
        }
Beispiel #4
0
    // -- Sprオブジェクトの構築を行う
    public override ObjectIf Build()
    {
        SEH_Exception.init();

        FWAppBehaviour appB = GetComponent <FWAppBehaviour>();

        PHSceneIf phScene;

        if (appB != null)
        {
            FWApp app = FWAppBehaviour.app;
            phSdk   = app.GetSdk().GetPHSdk();
            phScene = app.GetSdk().GetScene(0).GetPHScene();
            phScene.Clear();
            phScene.SetDesc((PHSceneDesc)desc);
        }
        else
        {
            phSdk   = PHSdkIf.CreateSdk();
            phScene = phSdk.CreateScene((PHSceneDesc)desc);
        }

        return(phScene);
    }
Beispiel #5
0
        static string brk = "n";        // set "y" if run under debugger

        static void Main(string[] args)
        {
            var dllDirectory = @"..\..\..\..\..\..\..\libs\bin\win64";
            var dllPath      = Environment.GetEnvironmentVariable("PATH") + ";" + dllDirectory;

            Environment.SetEnvironmentVariable("PATH", dllPath);

            ExceptionRaiser er = new ExceptionRaiser();

            try {
                if (inc.Equals("A"))
                {
                    inc = def;
                }
#if SprCSTest
                if (check_test("C"))
                {
                    test_constructor();
                }
#endif
                if (check_test("i"))
                {
                    test_intrinsic();
                }
                if (check_test("t"))
                {
                    test_tostring();
                }
                if (check_test("v"))
                {
                    test_vector();
                }
                if (check_test("a"))
                {
                    test_array();
                }
                if (check_test("c"))
                {
                    test_type_conv();
                }
                if (check_test("f"))
                {
                    test_func_args();
                }
                if (check_test("r"))
                {
                    test_func_return();
                }
                if (check_test("o"))
                {
                    test_operator();
                }
                if (check_test("F"))
                {
                    test_func_call();
                }
                if (check_test("s"))
                {
                    test_simulation();
                }
            }
            catch (System.Exception e) {
                System.Console.WriteLine(SEH_Exception.what(e));
            }
            CSlog.Print("Test End");
        }
Beispiel #6
0
        static string brk = "n";        // set "y" if run under debugger

        static void Main(string[] args)
        {
            ExceptionRaiser er = new ExceptionRaiser();

            try {
                if (inc.Equals("A"))
                {
                    inc = def;
                }
#if SprCSTest
                if (check_test("C"))
                {
                    test_constructor();
                }
#endif
                if (check_test("i"))
                {
                    test_intrinsic();
                }
                if (check_test("t"))
                {
                    test_tostring();
                }
                if (check_test("v"))
                {
                    test_vector();
                }
                if (check_test("a"))
                {
                    test_array();
                }
                if (check_test("c"))
                {
                    test_type_conv();
                }
                if (check_test("f"))
                {
                    test_func_args();
                }
                if (check_test("r"))
                {
                    test_func_return();
                }
                if (check_test("o"))
                {
                    test_operator();
                }
                if (check_test("F"))
                {
                    test_func_call();
                }
                if (check_test("s"))
                {
                    test_simulation();
                }
            }
            catch (System.Exception e) {
                System.Console.WriteLine(SEH_Exception.what(e));
            }
            CSlog.Print("Test End");
        }