コード例 #1
0
        public GamePage(string launchArguments)
        {
            this.InitializeComponent();

            // Create the game.
            _game = XamlGame <AlphaTestGame> .Create(launchArguments, Window.Current.CoreWindow, this);
        }
コード例 #2
0
        //-------------------------------------------------------------------------------------
        // Class constructors

        public CubeObject(AlphaTestGame game, Vector3 position, Texture2D texture)
            : base(game)
        {
            // Have we already built the cube vertex array in a previous instance?
            if (_vertices == null)
            {
                // No, so build them now
                BuildVertices();
                // Create a vertex buffer
                _vertexBuffer = new VertexBuffer(game.GraphicsDevice, typeof(VertexPositionTexture), _vertices.Length, BufferUsage.WriteOnly);
                _vertexBuffer.SetData(_vertices);
            }

            // Set object properties
            Position      = position;
            ObjectTexture = texture;
        }