예제 #1
0
        public CCGameView(CGRect frame, NSOpenGLContext context) : base(frame, context)
        {
            ViewSize      = new CCSizeI((int)frame.Width, (int)frame.Height);
            viewportDirty = true;

            BeginInitialise();
        }
예제 #2
0
        protected override void OnResize(EventArgs e)
        {
            base.OnResize(e);

            ViewSize      = new CCSizeI(Size.Width, Size.Height);
            viewportDirty = true;
        }
예제 #3
0
 void ISurfaceHolderCallback.SurfaceChanged(ISurfaceHolder holder, Android.Graphics.Format format, int width, int height)
 {
     lock (androidViewLock)
     {
         SurfaceChanged(holder, format, width, height);
         ViewSize      = new CCSizeI(width, height);
         viewportDirty = true;
     }
 }
        void ViewSizeChanged(object sender, SizeChangedEventArgs e)
        {
            ViewSize = new CCSizeI((int)e.NewSize.Width, (int)e.NewSize.Height);

            // We need to ask the graphics device to resize the underlying swapchain/buffers
            graphicsDevice.PresentationParameters.BackBufferWidth  = ViewSize.Width;
            graphicsDevice.PresentationParameters.BackBufferHeight = ViewSize.Height;
            graphicsDevice.CreateSizeDependentResources();
            graphicsDevice.ApplyRenderTargets(null);

            UpdateViewport();

            platformInitialised = true;

            LoadGame();
        }