mirror of
https://github.com/simtactics/mysimulation.git
synced 2025-07-07 15:10:27 -04:00
Removed NioTSO client and server
- NioTSO client isn't needed because we're using RayLib - Added FreeSO's API server to handle most backend operations
This commit is contained in:
parent
f12ba1502b
commit
22191ce648
591 changed files with 53264 additions and 3362 deletions
44
server/tso.common/Rendering/Framework/3DTargetScene.cs
Executable file
44
server/tso.common/Rendering/Framework/3DTargetScene.cs
Executable file
|
@ -0,0 +1,44 @@
|
|||
using FSO.Common.Rendering.Framework.Camera;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
|
||||
namespace FSO.Common.Rendering.Framework
|
||||
{
|
||||
public class _3DTargetScene : _3DScene
|
||||
{
|
||||
public RenderTarget2D Target;
|
||||
private GraphicsDevice Device;
|
||||
private int Multisample = 0;
|
||||
public Color ClearColor = Color.Transparent;
|
||||
public _3DTargetScene(GraphicsDevice device, ICamera camera, Point size, int multisample) : this(device, size, multisample) { Camera = camera; }
|
||||
public _3DTargetScene(GraphicsDevice device, Point size, int multisample) : base(device)
|
||||
{
|
||||
Device = device;
|
||||
Multisample = multisample;
|
||||
SetSize(size);
|
||||
}
|
||||
|
||||
public void SetSize(Point size)
|
||||
{
|
||||
if (Target != null) Target.Dispose();
|
||||
Target = new RenderTarget2D(Device, size.X, size.Y, false, SurfaceFormat.Color, DepthFormat.Depth24Stencil8, Multisample, RenderTargetUsage.PreserveContents);
|
||||
}
|
||||
|
||||
public override void Draw(GraphicsDevice device)
|
||||
{
|
||||
var oldTargets = device.GetRenderTargets();
|
||||
device.SetRenderTarget(Target);
|
||||
device.Clear(ClearColor);
|
||||
device.DepthStencilState = DepthStencilState.Default;
|
||||
Camera.ProjectionDirty();
|
||||
base.Draw(device);
|
||||
device.SetRenderTargets(oldTargets);
|
||||
}
|
||||
|
||||
public override void Dispose()
|
||||
{
|
||||
base.Dispose();
|
||||
Target.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue