Inheritance: Java.Lang.Object, GLSurfaceView.IRenderer
Ejemplo n.º 1
0
        public GLView(AndroidApplication application)
            : base(application)
        {
            this.application = application;
            this.theEvent    = application.theEvent;

            SetEGLContextClientVersion(2);
            SetEGLConfigChooser(true);            //8, 8, 8, 8, 16, 0);
            renderer = new GLRenderer(application);
            SetRenderer(renderer);
        }
Ejemplo n.º 2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            View.MultipleTouchEnabled = true;

            // set up GL
            PreferredFramesPerSecond = 60;
            context = new EAGLContext(EAGLRenderingAPI.OpenGLES2);
            var view = (GLKView)this.View;

            view.Context             = context;
            view.DrawableDepthFormat = GLKViewDrawableDepthFormat.Format16;
            EAGLContext.SetCurrentContext(context);

            renderer = new GLRenderer(this);
            Delegate = renderer;

            // set view stuff
            View.MultipleTouchEnabled = true;
            if (desc.Orientation == ApplicationOrientations.Landscape)
            {
                frameVector = new Vector2(view.Frame.Height, view.Frame.Width);
            }
            else
            {
                frameVector = new Vector2(view.Frame.Width, view.Frame.Height);
            }

            // iAd
            if (enableAds)
            {
                iAdView                    = new ADBannerView();
                iAdView.AdLoaded          += new EventHandler(iAdLoaded);
                iAdView.FailedToReceiveAd += new EventHandler <AdErrorEventArgs>(iAdFailedToReceiveAd);
                var adSize = iAdView.SizeThatFits(new SizeF(frameVector.X, frameVector.Y));
                iAdView.Frame = new RectangleF(0, frameVector.Y - adSize.Height, 1, 1);
                View.AddSubview(iAdView);
                iAdView.Hidden = true;
            }
        }
Ejemplo n.º 3
0
        public GLView(AndroidApplication application)
            : base(application)
        {
            this.application = application;
            this.theEvent = application.theEvent;

            SetEGLContextClientVersion(2);
            SetEGLConfigChooser(true);//8, 8, 8, 8, 16, 0);
            renderer = new GLRenderer(application);
            SetRenderer(renderer);
        }
Ejemplo n.º 4
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();

            View.MultipleTouchEnabled = true;

            // set up GL
            PreferredFramesPerSecond = 60;
            context = new EAGLContext(EAGLRenderingAPI.OpenGLES2);
            var view = (GLKView)this.View;
            view.Context = context;
            view.DrawableDepthFormat = GLKViewDrawableDepthFormat.Format16;
            EAGLContext.SetCurrentContext(context);

            renderer = new GLRenderer(this);
            Delegate = renderer;

            // set view stuff
            View.MultipleTouchEnabled = true;
            if (desc.Orientation == ApplicationOrientations.Landscape) frameVector = new Vector2(view.Frame.Height, view.Frame.Width);
            else frameVector = new Vector2(view.Frame.Width, view.Frame.Height);

            // iAd
            if (enableAds)
            {
                iAdView = new ADBannerView();
                iAdView.AdLoaded += new EventHandler(iAdLoaded);
                iAdView.FailedToReceiveAd += new EventHandler<AdErrorEventArgs>(iAdFailedToReceiveAd);
                var adSize = iAdView.SizeThatFits(new SizeF(frameVector.X, frameVector.Y));
                iAdView.Frame = new RectangleF(0, frameVector.Y-adSize.Height, 1, 1);
                View.AddSubview(iAdView);
                iAdView.Hidden = true;
            }
        }