Compare commits

...

2 Commits

Author SHA1 Message Date
d86793197e add FNA to solution 2021-07-21 15:49:44 -04:00
a0030dcf0d add FNA build 2021-07-21 15:42:21 -04:00
6 changed files with 204 additions and 0 deletions

6
FNA/App.config Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
</configuration>

71
FNA/FNA.csproj Normal file
View File

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{A39F01F6-3124-4AFB-A7B1-AC822DFB4541}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>SemiColinGames</RootNamespace>
<AssemblyName>Sneak</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<LangVersion>8.0</LangVersion>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="FnaExtensionMethods.cs" />
<Compile Include="FnaProgram.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\FNA\FNA.csproj">
<Project>{35253ce1-c864-4cd3-8249-4d1319748e8f}</Project>
<Name>FNA</Name>
</ProjectReference>
<ProjectReference Include="..\..\Newtonsoft.Json\Src\Newtonsoft.Json\Newtonsoft.Json.csproj">
<Project>{60ba5cb8-55db-467a-8d9b-342bd4b50c23}</Project>
<Name>Newtonsoft.Json</Name>
</ProjectReference>
</ItemGroup>
<Import Project="..\Shared\Shared.projitems" Label="Shared" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -0,0 +1,20 @@
using Microsoft.Xna.Framework;
namespace SemiColinGames {
public static class FnaExtensionMethods {
// Point
public static Vector2 ToVector2(this Point p) {
return new Vector2(p.X, p.Y);
}
// Rectangle
public static Point Size(this Rectangle r) {
return new Point(r.Width, r.Height);
}
// Vector2
public static Point ToPoint(this Vector2 v) {
return new Point((int) v.X, (int) v.Y);
}
}
}

48
FNA/FnaProgram.cs Normal file
View File

@ -0,0 +1,48 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
namespace SemiColinGames {
public class DesktopGLDisplay : IDisplay {
private GameWindow window;
private GraphicsDeviceManager graphics;
public void Initialize(GameWindow window, GraphicsDeviceManager graphics) {
this.window = window;
this.graphics = graphics;
window.Title = "Sneak";
}
public void SetFullScreen(bool fullScreen) {
if (fullScreen) {
// In DesktopGL, we misappropriate "fullscreen" to be "the settings good for recording
// gameplay GIFs".
// window.IsBorderless = true;
// graphics.PreferredBackBufferWidth = 720;
// graphics.PreferredBackBufferHeight = 405;
graphics.PreferredBackBufferWidth = graphics.GraphicsDevice.DisplayMode.Width;
graphics.PreferredBackBufferHeight = graphics.GraphicsDevice.DisplayMode.Height;
} else {
// window.IsBorderless = false;
graphics.PreferredBackBufferWidth = 1280;
graphics.PreferredBackBufferHeight = 720;
}
Debug.WriteLine("display: {0}x{1}, fullscreen={2}",
graphics.PreferredBackBufferWidth,
graphics.PreferredBackBufferHeight,
fullScreen);
graphics.ApplyChanges();
}
}
public static class DesktopGLProgram {
[STAThread]
static void Main() {
using (var game = new SneakGame()) {
game.Services.AddService(typeof(IDisplay), new DesktopGLDisplay());
game.Run();
}
}
}
}

View File

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("sneak-fna")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("sneak-fna")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("a39f01f6-3124-4afb-a7b1-ac822dfb4541")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -20,10 +20,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Newtonsoft.Json", "..\Newtonsoft.Json\Src\Newtonsoft.Json\Newtonsoft.Json.csproj", "{A4BB5AB0-821E-42C9-9F77-0EF7F737B9D1}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Newtonsoft.Json", "..\Newtonsoft.Json\Src\Newtonsoft.Json\Newtonsoft.Json.csproj", "{A4BB5AB0-821E-42C9-9F77-0EF7F737B9D1}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FNA", "FNA\FNA.csproj", "{A39F01F6-3124-4AFB-A7B1-AC822DFB4541}"
EndProject
Global Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution GlobalSection(SharedMSBuildProjectFiles) = preSolution
Shared\Shared.projitems*{21570905-5ffd-49fc-b523-1e7e6f191142}*SharedItemsImports = 4 Shared\Shared.projitems*{21570905-5ffd-49fc-b523-1e7e6f191142}*SharedItemsImports = 4
Shared\Shared.projitems*{2785994a-a14f-424e-8e77-2e464d28747f}*SharedItemsImports = 13 Shared\Shared.projitems*{2785994a-a14f-424e-8e77-2e464d28747f}*SharedItemsImports = 13
Shared\Shared.projitems*{a39f01f6-3124-4afb-a7b1-ac822dfb4541}*SharedItemsImports = 4
Shared\Shared.projitems*{c86694a5-dd99-4421-aa2c-1230f11c10f8}*SharedItemsImports = 5 Shared\Shared.projitems*{c86694a5-dd99-4421-aa2c-1230f11c10f8}*SharedItemsImports = 5
Shared\Shared.projitems*{e25e2743-f2fd-437b-9411-e55c104451ff}*SharedItemsImports = 5 Shared\Shared.projitems*{e25e2743-f2fd-437b-9411-e55c104451ff}*SharedItemsImports = 5
EndGlobalSection EndGlobalSection
@ -139,6 +142,26 @@ Global
{A4BB5AB0-821E-42C9-9F77-0EF7F737B9D1}.Release|x64.Build.0 = Release|Any CPU {A4BB5AB0-821E-42C9-9F77-0EF7F737B9D1}.Release|x64.Build.0 = Release|Any CPU
{A4BB5AB0-821E-42C9-9F77-0EF7F737B9D1}.Release|x86.ActiveCfg = Release|Any CPU {A4BB5AB0-821E-42C9-9F77-0EF7F737B9D1}.Release|x86.ActiveCfg = Release|Any CPU
{A4BB5AB0-821E-42C9-9F77-0EF7F737B9D1}.Release|x86.Build.0 = Release|Any CPU {A4BB5AB0-821E-42C9-9F77-0EF7F737B9D1}.Release|x86.Build.0 = Release|Any CPU
{A39F01F6-3124-4AFB-A7B1-AC822DFB4541}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A39F01F6-3124-4AFB-A7B1-AC822DFB4541}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A39F01F6-3124-4AFB-A7B1-AC822DFB4541}.Debug|ARM.ActiveCfg = Debug|Any CPU
{A39F01F6-3124-4AFB-A7B1-AC822DFB4541}.Debug|ARM.Build.0 = Debug|Any CPU
{A39F01F6-3124-4AFB-A7B1-AC822DFB4541}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{A39F01F6-3124-4AFB-A7B1-AC822DFB4541}.Debug|ARM64.Build.0 = Debug|Any CPU
{A39F01F6-3124-4AFB-A7B1-AC822DFB4541}.Debug|x64.ActiveCfg = Debug|Any CPU
{A39F01F6-3124-4AFB-A7B1-AC822DFB4541}.Debug|x64.Build.0 = Debug|Any CPU
{A39F01F6-3124-4AFB-A7B1-AC822DFB4541}.Debug|x86.ActiveCfg = Debug|Any CPU
{A39F01F6-3124-4AFB-A7B1-AC822DFB4541}.Debug|x86.Build.0 = Debug|Any CPU
{A39F01F6-3124-4AFB-A7B1-AC822DFB4541}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A39F01F6-3124-4AFB-A7B1-AC822DFB4541}.Release|Any CPU.Build.0 = Release|Any CPU
{A39F01F6-3124-4AFB-A7B1-AC822DFB4541}.Release|ARM.ActiveCfg = Release|Any CPU
{A39F01F6-3124-4AFB-A7B1-AC822DFB4541}.Release|ARM.Build.0 = Release|Any CPU
{A39F01F6-3124-4AFB-A7B1-AC822DFB4541}.Release|ARM64.ActiveCfg = Release|Any CPU
{A39F01F6-3124-4AFB-A7B1-AC822DFB4541}.Release|ARM64.Build.0 = Release|Any CPU
{A39F01F6-3124-4AFB-A7B1-AC822DFB4541}.Release|x64.ActiveCfg = Release|Any CPU
{A39F01F6-3124-4AFB-A7B1-AC822DFB4541}.Release|x64.Build.0 = Release|Any CPU
{A39F01F6-3124-4AFB-A7B1-AC822DFB4541}.Release|x86.ActiveCfg = Release|Any CPU
{A39F01F6-3124-4AFB-A7B1-AC822DFB4541}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE