Beispiel #1
0
 /// <summary>
 /// Sets the graphics settings to the default values of this game engine.
 /// </summary>
 public void initialize()
 {
     graphics.CreateDevice();
     graphics.PreferredBackBufferWidth  = graphics.GraphicsDevice.DisplayMode.Width;
     graphics.PreferredBackBufferHeight = graphics.GraphicsDevice.DisplayMode.Height;
     graphics.ApplyChanges();
 }
Beispiel #2
0
 public void Initialise()
 {
     graphics.CreateDevice();
     //graphics.PreferredBackBufferWidth = graphics.GraphicsDevice.DisplayMode.Width;
     //graphics.PreferredBackBufferHeight = graphics.GraphicsDevice.DisplayMode.Height;
     //graphics.IsFullScreen = true;
     graphics.ApplyChanges();
 }
        public void Setup()
        {
            _game = new TestGameBase();
            var graphicsDeviceManager = new GraphicsDeviceManager(_game);

#if XNA
            graphicsDeviceManager.ApplyChanges();
#else
            graphicsDeviceManager.CreateDevice();
#endif
        }
Beispiel #4
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            graphics.PreferredBackBufferWidth  = 1280; // set this value to the desired width of your window
            graphics.PreferredBackBufferHeight = 800;  // set this value to the desired height of your window
            graphics.ApplyChanges();
            graphics.CreateDevice();

            Content.RootDirectory = "Content";

            this.IsMouseVisible = true;
        }
        public GraphicsDeviceTestHelper()
        {
            _form = new Form();
            _game = new Game();
            GraphicsDeviceManager = new GraphicsDeviceManager(_game);

            var gds = GraphicsDeviceServiceTestHelper.AddRef(_form.Handle, _form.ClientSize.Width, _form.ClientSize.Height);

            _serviceContainer = new ServiceContainer();
            _serviceContainer.AddService(typeof(IGraphicsDeviceService), gds);

            GraphicsDeviceManager.CreateDevice();
        }
Beispiel #6
0
        public Principal()
            : base()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            graphics.CreateDevice();

            graphics.PreferredBackBufferWidth  = anchoesc;
            graphics.PreferredBackBufferHeight = altoesc;
            graphics.ApplyChanges();
            graphics.IsFullScreen = false;
        }
    public GameEnvironment()
    {
        Content.RootDirectory = "Content";

        graphics = new GraphicsDeviceManager(this);
        graphics.CreateDevice();

        inputHelper         = new InputHelper();
        gameStateManager    = new GameStateManager();
        spriteScale         = Matrix.CreateScale(1, 1, 1);
        random              = new Random();
        gameSettingsManager = new GameSettingsManager();

        DefaultCamera = new Camera();
    }
        public CCApplication(Game game, GraphicsDeviceManager graphics)
            : base(game)
        {
            this.game     = game;
            this.graphics = graphics;
            this.content  = game.Content;

            // MonoGame 3D
#if MONO3D
            if (graphics.GraphicsDevice == null)
            {
                graphics.CreateDevice();
            }
#endif
#if WINDOWS || XBOX || XBOX360
            graphics.DeviceCreated += new EventHandler <EventArgs>(graphics_DeviceCreated);
#endif
            game.Window.OrientationChanged += Window_OrientationChanged;

            TouchPanel.EnabledGestures = GestureType.Tap;

            //m_pTouch = new CCTouch();
            //m_pSet = new List<CCTouch>();
            m_pTouches  = new LinkedList <CCTouch>();
            m_pTouchMap = new Dictionary <int, LinkedListNode <CCTouch> >();

            m_fScreenScaleFactor = 1.0f;

#warning "set height and width as Graphics.Device.Viewport"

#if WP7 || WINPHONE || WINDOWS_PHONE
            m_rcViewPort = new Rectangle(0, 0, 800, 480); //graphics.GraphicsDevice.Viewport.Width, graphics.GraphicsDevice.Viewport.Height);
            _size        = new CCSize(800, 480);
#elif !WINDOWS && !XBOX && !XBOX360
            if (graphics.GraphicsDevice == null)
            {
                graphics.DeviceCreated += new EventHandler <EventArgs>(graphics_DeviceCreated);
            }
            else
            {
                m_rcViewPort = new Rectangle(0, 0, graphics.GraphicsDevice.Viewport.Width, graphics.GraphicsDevice.Viewport.Height);
                _size        = new CCSize(graphics.GraphicsDevice.Viewport.Width, graphics.GraphicsDevice.Viewport.Height);
            }
#endif
        }
Beispiel #9
0
        public void init()
        {
            reference = new Color[a];
            _game     = new Game();
            var graphicsDeviceManager = new GraphicsDeviceManager(_game);

            graphicsDeviceManager.GraphicsProfile = GraphicsProfile.HiDef;
#if XNA
            graphicsDeviceManager.ApplyChanges();
#else
            graphicsDeviceManager.CreateDevice();
#endif

            t = new Texture3D(_game.GraphicsDevice, w, h, d, false, SurfaceFormat.Color);
            for (int layer = 0; layer < d; layer++)
            {
                for (int i = 0; i < w * h; i++)
                {
                    reference[layer * w * h + i] = new Color(layer * 5, layer * 5, layer * 5, layer * 5);
                }
            }
        }