Ejemplo n.º 1
0
        public void ElementSizeChanged(double w, double h)
        {
            if (oglView != null)
            {
                //
                // 現在のOGLViewを削除
                baseView.RemoveView(oglView);
                oglView.Dispose();
                oglView = null;
            }

            oglView = new OGLView(this.Context)
            {
                Sphere         = ((EquirectanglarView)Element).Sphere,
                VertexShader   = ((EquirectanglarView)Element).VertexShader,
                FragmentShader = ((EquirectanglarView)Element).FragmentShader,
                TextureImage   = ((EquirectanglarView)Element).TextureImage
            };
            baseView.AddView(oglView, LayoutParams.MatchParent);
        }
Ejemplo n.º 2
0
        public Form1()
        {
            Common.ViewModelSyncRoot.Init();
            InitializeComponent();
            AllowDrop  = true;
            DragEnter += (o, e) =>
            {
                if (e.Data.GetDataPresent(DataFormats.FileDrop))
                {
                    e.Effect = DragDropEffects.Link;
                }
                else
                {
                    e.Effect = DragDropEffects.None;
                }
            };
            DragDrop += OnDropFileAsync;

            GLView = new OGLView()
            {
                Location     = new System.Drawing.Point(0, 0),
                Name         = "oglv",
                Size         = ClientSize,
                ResizeBGDraw = false
            };
            Core = new RenderCore();
            OperateTargets[0] = Core.TheScene.MainCamera;
            OperateTargets[1] = Core.TheScene.Drawables.LastOrDefault();
            OperateTargets[2] = Core.TheScene.Lights.LastOrDefault();
            Core.Resize((uint)ClientSize.Width, (uint)ClientSize.Height);

            Controls.Add(GLView);
            Resize      += (o, e) => { GLView.Size = ClientSize; };
            FormClosing += (o, e) => { Core.Dispose(); Core = null; };

            GLView.Draw    += Core.Draw;
            GLView.Resize  += (o, e) => { Core.Resize((uint)e.Width, (uint)e.Height); };
            GLView.KeyDown += OnKeyDown;
            //oglv.KeyAction += OnKeyAction;
            GLView.MouseAction += OnMouse;
        }
Ejemplo n.º 3
0
        public void ElementSizeChanged(double w, double h)
        {
            if (oglView != null)
            {
                //
                // 現在のOGLViewを削除
                oglView.RemoveFromSuperview();
                oglView.Dispose();
                oglView = null;
            }

            oglView = new OGLView(new CGRect(0, 0, w, h))
            {
                Sphere         = ((EquirectanglarView)Element).Sphere,
                VertexShader   = ((EquirectanglarView)Element).VertexShader,
                FragmentShader = ((EquirectanglarView)Element).FragmentShader,
                TextureImage   = ((EquirectanglarView)Element).TextureImage
            };
            baseView.Add(oglView);
            //
            // iOSでは iPhoneOSGameView::OnLoadがコールされないので、ここで明示的にInitializeをコールする
            //
            oglView.Initialize();
        }