コード例 #1
0
ファイル: TiledBoxVisual.cs プロジェクト: Tristyn/MCFire
        public virtual void LoadContent(IEditorGame game)
        {
            var effect = new BoxSelectEffect(game.LoadContent <Effect>("BoxSelect"))
            {
                Sampler = game.GraphicsDevice.SamplerStates.PointWrap,
                Main    = _texture
            };

            _effect  = effect;
            _texture = game.LoadContent <Texture2D>("Grid");

            foreach (var face in FacesUtils.AllFaces)
            {
                var mesh = new Mesh <VertexPositionTexture>(Buffer.Vertex.New(game.GraphicsDevice, CreateQuadUv(face)), effect.Effect);
                SetQuad(face, mesh);
            }
        }
コード例 #2
0
        void LoadContent(IEditorGame game)
        {
            var arrowDesc = new TruncatedConeDescription(
                new ConeSection(0, 0),
                new ConeSection(.03f, 0),
                new ConeSection(.03f, 2f / 3),
                new ConeSection(.10f, 2f / 3),
                new ConeSection(0, 1f));

            var arrowMesh   = new TruncatedConeBuilder().Build(arrowDesc);
            var arrowBuffer = Buffer.Vertex.New(game.GraphicsDevice, arrowMesh);
            var effect      = new FullColorEffect(game.LoadContent <Effect>("FullColor"));

            _effect    = effect;
            _arrowMesh = new Mesh <VertexPosition>(arrowBuffer, effect.Effect);
        }
コード例 #3
0
ファイル: WorldRenderer.cs プロジェクト: Tristyn/MCFire
        public void LoadContent([NotNull] IEditorGame game)
        {
            _game      = game;
            _vertexLit = new VertexLitEffect(game.LoadContent <Effect>("VertexLit"));

            // TODO: settings
            var mesher = _meshalyzers.LastOrDefault();

            if (mesher == null)
            {
                return;
            }

            SwitchMeshalyzer(mesher);
            Policy = ChunkCreationPolicy.Run;
            game.World.ChunksModified += ChunksModified;
        }