public override void Draw(Camera camera) { var old = Game1.GameInstance.GraphicsDevice.RasterizerState; Game1.GameInstance.GraphicsDevice.RasterizerState = new RasterizerState { FillMode = FillMode.WireFrame }; effect.World = World; effect.View = camera.View; effect.Projection = camera.Projection; effect.LightingEnabled = true; if (!flash) effect.EmissiveColor = Color; else flash = false; foreach (ModelMesh mesh in model.Meshes) { foreach (ModelMeshPart mmp in mesh.MeshParts) { mmp.Effect = effect; foreach (EffectPass pass in effect.CurrentTechnique.Passes) { pass.Apply(); } } mesh.Draw(); } Game1.GameInstance.GraphicsDevice.RasterizerState = old; }
public override void Draw(Camera camera) { Game1.GameInstance.GraphicsDevice.SetVertexBuffer(VertexBuffer); effect.World = World; effect.View = camera.View; effect.Projection = camera.Projection; effect.VertexColorEnabled = true; foreach (EffectPass pass in effect.CurrentTechnique.Passes) { pass.Apply(); switch (Format) { case PrimitiveFormat.Color: Game1.GameInstance.GraphicsDevice.DrawUserPrimitives(Type, ColorVerts, VertexOffset, PrimitiveCount); break; case PrimitiveFormat.ColorTexture: Game1.GameInstance.GraphicsDevice.DrawUserPrimitives(Type, ColorTextureVerts, VertexOffset, PrimitiveCount); break; case PrimitiveFormat.NormalTexture: Game1.GameInstance.GraphicsDevice.DrawUserPrimitives(Type, NormalTextureVerts, VertexOffset, PrimitiveCount); break; case PrimitiveFormat.Texture: Game1.GameInstance.GraphicsDevice.DrawUserPrimitives(Type, TextureVerts, VertexOffset, PrimitiveCount); break; } } }
protected override void Initialize() { CollisionManager = CollisionManager.GetInstance(this); InputManager = InputManager.GetInstance(this); BasicManager = BasicManager.GetInstance(this); if (useBloom) bloom = new BloomComponent(this); Overlay = new Overlay(this); Camera = new Camera(this); StateManager = new StateManager(this); Components.Add(InputManager); //Components.Add(BasicManager); //Components.Add(CollisionManager); Components.Add(StateManager); //if (useBloom) // Components.Add(bloom); //Components.Add(Overlay); //Components.Add(Camera); base.Initialize(); }
public abstract void Draw(Camera camera);