Esempio n. 1
0
        /// <summary>
        /// OnPaint
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void GlPreviewControl_Paint(object sender, PaintEventArgs e)
        {
            //
            GlPreviewControl.MakeCurrent();
            Display.ClearBuffers();


            SpriteBatch.Begin();

            // Background texture
            Rectangle dst = new Rectangle(Point.Empty, GlPreviewControl.Size);

            SpriteBatch.Draw(CheckerBoard, dst, dst, Color.White);



            Animation.Draw(SpriteBatch, AnimOffset);

            /*
             * Tile tile = Animation.CurrentTile;
             * if (tile == null)
             * {
             *      GlPreviewControl.SwapBuffers();
             *      return;
             * }
             * Rectangle rect = new Rectangle(AnimOffset, tile.Size);
             *
             * Animation.TileSet.Draw(Animation.CurrentFrame, AnimOffset);
             */

            SpriteBatch.End();
            GlPreviewControl.SwapBuffers();
        }
Esempio n. 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void GlPreviewControl_Paint(object sender, PaintEventArgs e)
        {
            if (SpriteBatch == null)
            {
                return;
            }

            GlPreviewControl.MakeCurrent();

            Display.ClearBuffers();

            if (Maze == null)
            {
                GlPreviewControl.SwapBuffers();
                return;
            }

            SpriteBatch.Begin();
            Maze.Draw(SpriteBatch, PreviewLoc);
            SpriteBatch.End();

            GlPreviewControl.SwapBuffers();
        }