mirror of
https://github.com/simtactics/mysimulation.git
synced 2025-07-07 07:00:33 -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
68
server/tso.common/Utils/FeatureLevelTest.cs
Executable file
68
server/tso.common/Utils/FeatureLevelTest.cs
Executable file
|
@ -0,0 +1,68 @@
|
|||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
|
||||
namespace FSO.Common.Utils
|
||||
{
|
||||
public class FeatureLevelTest
|
||||
{
|
||||
public static bool UpdateFeatureLevel(GraphicsDevice gd)
|
||||
{
|
||||
//if 3d is enabled, check if we support non-power-of-two mipmaps
|
||||
if (FSOEnvironment.SoftwareKeyboard && FSOEnvironment.SoftwareDepth)
|
||||
{
|
||||
FSOEnvironment.EnableNPOTMip = false;
|
||||
return true;
|
||||
}
|
||||
try
|
||||
{
|
||||
using (var mipTest = new Texture2D(gd, 11, 11, true, SurfaceFormat.Color))
|
||||
{
|
||||
var data = new Color[11 * 11];
|
||||
TextureUtils.UploadWithMips(mipTest, gd, data);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
FSOEnvironment.EnableNPOTMip = false;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
using (var mipTest = new Texture2D(gd, 4, 4, true, SurfaceFormat.Dxt5))
|
||||
{
|
||||
var data = new byte[16];
|
||||
mipTest.SetData(data);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
FSOEnvironment.TexCompressSupport = false;
|
||||
}
|
||||
|
||||
//msaa test
|
||||
try
|
||||
{
|
||||
var msaaTarg = new RenderTarget2D(gd, 1, 1, false, SurfaceFormat.Color, DepthFormat.None, 8, RenderTargetUsage.PreserveContents);
|
||||
gd.SetRenderTarget(msaaTarg);
|
||||
gd.Clear(Color.Red);
|
||||
|
||||
var tex = TextureUtils.CopyAccelerated(gd, msaaTarg);
|
||||
|
||||
var result = new Color[1];
|
||||
tex.GetData(result);
|
||||
FSOEnvironment.MSAASupport = result[0] == Color.Red;
|
||||
gd.SetRenderTarget(null);
|
||||
msaaTarg.Dispose();
|
||||
tex.Dispose();
|
||||
}
|
||||
catch
|
||||
{
|
||||
gd.SetRenderTarget(null);
|
||||
FSOEnvironment.MSAASupport = false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue