Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new Configurator class.
        /// </summary>
        /// <param name="targetFrameRate">The TargetFrameRate.</param>
        /// <param name="backbuffer">The BackBuffer.</param>
        /// <param name="gameInstance">The GameInstance.</param>
        /// <param name="renderTarget">The RenderTarget.</param>
        public Configurator(int targetFrameRate, BackBuffer backbuffer, Game gameInstance,
            RenderTarget renderTarget)
        {
            if (!renderTarget.IsValid)
            {
                throw new InvalidOperationException("RenderTarget is not valid.");
            }

            TargetFrameRate = targetFrameRate;
            BackBuffer = backbuffer;
            GameInstance = gameInstance;
            RenderTarget = renderTarget;
        }
Exemplo n.º 2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            BackBuffer backBuffer = new BackBuffer(800,600);
            Game game = new Pong.Core.Pong();
            RenderTarget renderTarget = RenderTarget.Create();
            renderTarget.Window.Position = new Sharpex2D.Math.Vector2()
            {
                X = (Screen.PrimaryScreen.Bounds.Width - backBuffer.Width) / 2,
                Y = (Screen.PrimaryScreen.Bounds.Height - backBuffer.Height) / 2
            };
            Configurator config = new Configurator(backBuffer, game, renderTarget);
            SGL.Initialize(config);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Initializes a new Configurator class.
 /// </summary>
 /// <param name="backbuffer">The BackBuffer.</param>
 /// <param name="gameInstance">The GameInstance.</param>
 /// <param name="renderTarget">The RenderTarget.</param>
 public Configurator(BackBuffer backbuffer, Game gameInstance, RenderTarget renderTarget)
     : this(60, backbuffer, gameInstance, renderTarget)
 {
 }