freeso/TSOClient/tso.debug/Content/Preview/MeshPreviewComponent.cs
riperiperi b57ebbd141 Cleanup: Remove most unused usings and MPL per-file licenses
MPL per-file was used in older project files, but should apply to the whole project, so having it there was redundant.
2023-11-25 03:45:29 +00:00

43 lines
1.1 KiB
C#

using System;
using FSO.Common.Rendering.Framework;
using FSO.Vitaboy;
using Microsoft.Xna.Framework.Graphics;
namespace FSO.Debug.content.preview
{
public class MeshPreviewComponent : _3DComponent
{
public Mesh Mesh;
public Texture2D Texture;
public override void Update(FSO.Common.Rendering.Framework.Model.UpdateState state)
{
}
public override void Draw(Microsoft.Xna.Framework.Graphics.GraphicsDevice device)
{
if (Mesh == null) { return; }
var effect = new BasicEffect(device);
effect.World = World;
effect.View = View;
effect.Projection = Projection;
if (Texture != null)
{
effect.TextureEnabled = true;
effect.Texture = Texture;
}
foreach (var pass in effect.CurrentTechnique.Passes)
{
pass.Apply();
Mesh.Draw(device);
}
}
public override void DeviceReset(GraphicsDevice Device)
{
throw new NotImplementedException();
}
}
}