コード例 #1
0
    // ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
    // MonoBehaviourのメソッド

    void Awake()
    {
        if (!enabled)
        {
            return;
        }

        if (app == null)
        {
            app = new FWApp();

            app.CreateSdk();

            FWSceneIf fwScene = app.GetSdk().CreateScene(new PHSceneDesc(), new GRSceneDesc());
            fwScene.SetRenderMode(true, true);
            fwScene.EnableRenderPHScene(true);
            fwScene.EnableRenderForce(true, true);

            GRDeviceIf device = app.GRInit();

            FWWinIf nullwin = new FWWinIf(); nullwin._this = (System.IntPtr) 0;
            FWWinIf win     = app.CreateWin(new FWWinDesc(), nullwin);

            mainloop = new Thread(new ThreadStart(MainLoop));
            mainloop.Start();
        }
    }
コード例 #2
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);
        }