示例#1
0
        public override void LoadView()
        {
            base.LoadView();

            Utility = new XMUtilities();

            Utility.SetCallback(new XMUtilityCallback(OurCallback));

            var operandSection = new Section("Operands")
            {
                new EntryElement("Name: ", "", ""),
                new EntryElement("Operand One: ", "", ""),
                new EntryElement("Operand Two: ", "", ""),
            };

            var operationSection = new Section("Operations")
            {
                new StringElement("Add", Handle_AddOperation),
                new StringElement("Multiply", Handle_MultiplyOperation),
                new StringElement("Hello", Handle_HelloOperation),
                new StringElement("Invoke Callback", Handle_InvokeCallback),
            };

            var resultSection = new Section("Result")
            {
                new StringElement(@"")
            };

            var customViewSection = new Section("More Bindings")
            {
                new StringElement("Go to CustomView!", () => {
                    var c = new CustomViewController();

                    this.NavigationController.PushViewController(c, true);
                })
            };

            this.Root.Add(new Section[] { operandSection, operationSection, resultSection, customViewSection });
        }
示例#2
0
        void IGLKViewDelegate.DrawInRect(GLKView view, CoreGraphics.CGRect rect)
        {
                        #if _SAMPLE
            GL.ClearColor(0.65f, 0.65f, 0.65f, 1.0f);
            GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);

            GL.Oes.BindVertexArray(vertexArray);

            // Render the object with GLKit
            effect.PrepareToDraw();

            GL.DrawArrays(BeginMode.Triangles, 0, 36);

            // Render the object again with ES2
            GL.UseProgram(program);

            GL.UniformMatrix4(uniforms [(int)Uniform.ModelViewProjection_Matrix], false, ref modelViewProjectionMatrix);
            GL.UniformMatrix3(uniforms [(int)Uniform.Normal_Matrix], false, ref normalMatrix);

            GL.DrawArrays(BeginMode.Triangles, 0, 36);
                        #endif
                        #if _ENGINE
            if (!Initialized)
            {
                Initialized = true;

                int [] viewport = new int[4];
                GL.GetInteger(GetPName.Viewport, viewport);
                //CGSize size = View.Bounds.Size;
                //int DeviceWidth = (int) UIScreen.MainScreen.Bounds.Width ;
                //int DeviceHeight = (int) UIScreen.MainScreen.Bounds.Height;
                Utility = new XMUtilities();
                XamarinInit(viewport[2], viewport[3], (int)rect.Width, (int)rect.Height);
            }
            XamarinRender();
                        #endif
        }