コード例 #1
0
 public GameView(Android.Content.Context context, Input input) : base(context)
 {
     this.input               = input;
     androidSoftKeyboard      = new AndroidSoftKeyboard(this);
     Application.SoftKeyboard = androidSoftKeyboard;
     for (int i = 0; i < Input.MaxTouches; i++)
     {
         pointerIds[i] = -1;
     }
     keyboardHandler = new KeyboardHandler(input);
     SetOnKeyListener(keyboardHandler);
     stopwatch.Start();
 }
コード例 #2
0
        public GameView(Android.Content.Context context, Input input) : base(context)
        {
            this.AutoSetContextOnRenderFrame = false;
            this.input               = input;
            androidSoftKeyboard      = new AndroidSoftKeyboard(this);
            Application.SoftKeyboard = androidSoftKeyboard;
            for (int i = 0; i < Input.MaxTouches; i++)
            {
                pointerIds[i] = -1;
            }
            keyboardHandler = new KeyboardHandler(input);
            SetOnKeyListener(keyboardHandler);
            RestrictSupportedOrientationsWith(Application.SupportedDeviceOrientations);
            var readyToRenderGetter = typeof(OpenTK.Platform.Android.AndroidGameView).GetProperty("ReadyToRender",
                                                                                                  System.Reflection.BindingFlags.Instance |
                                                                                                  System.Reflection.BindingFlags.NonPublic).GetMethod;

            readyToRender = (Func <bool>)readyToRenderGetter.CreateDelegate(typeof(Func <bool>), this);
        }
コード例 #3
0
ファイル: AndroidGameView.cs プロジェクト: x5f3759df/Citrus
        public GameView(Android.Content.Context context, Input input) : base(context)
        {
            this.input               = input;
            androidSoftKeyboard      = new AndroidSoftKeyboard(this);
            Application.SoftKeyboard = androidSoftKeyboard;
            for (int i = 0; i < Input.MaxTouches; i++)
            {
                pointerIds[i] = -1;
            }
            keyboardHandler = new KeyboardHandler(input);
            SetOnKeyListener(keyboardHandler);

            egl = EGLContext.EGL.JavaCast <IEGL10>();

            holder = Holder;
            holder.AddCallback(this);
            holder.SetType(SurfaceType.Gpu);

            windowManager = context.GetSystemService(Android.Content.Context.WindowService).JavaCast <IWindowManager>();
        }