Revive Bizware.Test executable

This commit is contained in:
YoshiRulz 2021-07-22 06:04:27 +10:00
parent a223072810
commit d1205fa807
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
4 changed files with 52 additions and 173 deletions

View File

@ -1,104 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{B9925307-6A8F-4CD0-8EFB-0617FF0AE5AD}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>BizHawk.Bizware.Test</RootNamespace>
<AssemblyName>BizHawk.Bizware.Test</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="OpenTK, Version=1.1.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\References\OpenTK.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="TestForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="TestForm.Designer.cs">
<DependentUpon>TestForm.cs</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BizHawk.Bizware.BizwareGL.OpenTK\BizHawk.Bizware.BizwareGL.OpenTK.csproj">
<Project>{5160CFB1-5389-47C1-B7F6-8A0DC97641EE}</Project>
<Name>BizHawk.Bizware.BizwareGL.OpenTK</Name>
</ProjectReference>
<ProjectReference Include="..\BizHawk.Bizware.BizwareGL\BizHawk.Bizware.BizwareGL.csproj">
<Project>{9F84A0B2-861E-4EF4-B89B-5E2A3F38A465}</Project>
<Name>BizHawk.Bizware.BizwareGL</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="TestForm.resx">
<DependentUpon>TestForm.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="TestImages\flame1.jpg" />
<EmbeddedResource Include="TestImages\flame2.jpg" />
<EmbeddedResource Include="TestImages\flame3.jpg" />
<EmbeddedResource Include="TestImages\flame4.jpg" />
<EmbeddedResource Include="TestImages\flame5.jpg" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="TestImages\courier16px.fnt" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="TestImages\courier16px_0.png" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="TestImages\smile.png" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="TestImages\4xSoft.cg" />
<EmbeddedResource Include="TestImages\4xSoft.glsl" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net48</TargetFramework>
</PropertyGroup>
<Import Project="../MainSlnExecutable.props" />
<PropertyGroup>
<DefineConstants>$(DefineConstants);EXE_PROJECT</DefineConstants>
<Nullable>disable</Nullable>
<OutputPath>$(ProjectDir)bin<!--/$(Configuration)/$(TargetFramework)--></OutputPath>
</PropertyGroup>
<ItemGroup>
<Reference Include="System.Windows.Forms" />
<PackageReference Include="OpenTK" Version="3.3.2" PrivateAssets="all" NoWarn="NU1701" />
<ProjectReference Include="$(ProjectDir)../BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj" />
<EmbeddedResource Include="TestImages/**/*" />
</ItemGroup>
</Project>

View File

@ -1,54 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BizHawk.Bizware.BizwareGL", "BizHawk.Bizware.BizwareGL\BizHawk.Bizware.BizwareGL.csproj", "{9F84A0B2-861E-4EF4-B89B-5E2A3F38A465}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BizHawk.Bizware.Test", "BizHawk.Bizware.Test\BizHawk.Bizware.Test.csproj", "{B9925307-6A8F-4CD0-8EFB-0617FF0AE5AD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BizHawk.Bizware.BizwareGL.OpenTK", "BizHawk.Bizware.BizwareGL.OpenTK\BizHawk.Bizware.BizwareGL.OpenTK.csproj", "{5160CFB1-5389-47C1-B7F6-8A0DC97641EE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|Mixed Platforms = Debug|Mixed Platforms
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|Mixed Platforms = Release|Mixed Platforms
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9F84A0B2-861E-4EF4-B89B-5E2A3F38A465}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9F84A0B2-861E-4EF4-B89B-5E2A3F38A465}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9F84A0B2-861E-4EF4-B89B-5E2A3F38A465}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{9F84A0B2-861E-4EF4-B89B-5E2A3F38A465}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{9F84A0B2-861E-4EF4-B89B-5E2A3F38A465}.Debug|x86.ActiveCfg = Debug|Any CPU
{9F84A0B2-861E-4EF4-B89B-5E2A3F38A465}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9F84A0B2-861E-4EF4-B89B-5E2A3F38A465}.Release|Any CPU.Build.0 = Release|Any CPU
{9F84A0B2-861E-4EF4-B89B-5E2A3F38A465}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{9F84A0B2-861E-4EF4-B89B-5E2A3F38A465}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{9F84A0B2-861E-4EF4-B89B-5E2A3F38A465}.Release|x86.ActiveCfg = Release|Any CPU
{B9925307-6A8F-4CD0-8EFB-0617FF0AE5AD}.Debug|Any CPU.ActiveCfg = Debug|x86
{B9925307-6A8F-4CD0-8EFB-0617FF0AE5AD}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{B9925307-6A8F-4CD0-8EFB-0617FF0AE5AD}.Debug|Mixed Platforms.Build.0 = Debug|x86
{B9925307-6A8F-4CD0-8EFB-0617FF0AE5AD}.Debug|x86.ActiveCfg = Debug|x86
{B9925307-6A8F-4CD0-8EFB-0617FF0AE5AD}.Debug|x86.Build.0 = Debug|x86
{B9925307-6A8F-4CD0-8EFB-0617FF0AE5AD}.Release|Any CPU.ActiveCfg = Release|x86
{B9925307-6A8F-4CD0-8EFB-0617FF0AE5AD}.Release|Mixed Platforms.ActiveCfg = Release|x86
{B9925307-6A8F-4CD0-8EFB-0617FF0AE5AD}.Release|Mixed Platforms.Build.0 = Release|x86
{B9925307-6A8F-4CD0-8EFB-0617FF0AE5AD}.Release|x86.ActiveCfg = Release|x86
{B9925307-6A8F-4CD0-8EFB-0617FF0AE5AD}.Release|x86.Build.0 = Release|x86
{5160CFB1-5389-47C1-B7F6-8A0DC97641EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5160CFB1-5389-47C1-B7F6-8A0DC97641EE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5160CFB1-5389-47C1-B7F6-8A0DC97641EE}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{5160CFB1-5389-47C1-B7F6-8A0DC97641EE}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{5160CFB1-5389-47C1-B7F6-8A0DC97641EE}.Debug|x86.ActiveCfg = Debug|Any CPU
{5160CFB1-5389-47C1-B7F6-8A0DC97641EE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5160CFB1-5389-47C1-B7F6-8A0DC97641EE}.Release|Any CPU.Build.0 = Release|Any CPU
{5160CFB1-5389-47C1-B7F6-8A0DC97641EE}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{5160CFB1-5389-47C1-B7F6-8A0DC97641EE}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{5160CFB1-5389-47C1-B7F6-8A0DC97641EE}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@ -1,23 +1,37 @@
using System;
using System.Windows.Forms;
using System.Drawing;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.IO;
using System.Reflection;
using System.Windows.Forms;
using BizHawk.Bizware.BizwareGL;
using BizHawk.Bizware.BizwareGL.Drivers.OpenTK;
using OpenTK.Graphics.OpenGL;
using BizHawk.Bizware.OpenTK3;
using BizHawk.Client.EmuHawk;
namespace BizHawk.Bizware.Test
{
class Program
{
static unsafe void Main(string[] args)
static Program()
{
BizHawk.Bizware.BizwareGL.IGL igl = new BizHawk.Bizware.BizwareGL.Drivers.OpenTK.IGL_TK();
AppDomain.CurrentDomain.AssemblyResolve += (_, args) =>
{
lock (AppDomain.CurrentDomain)
{
var firstAsm = Array.Find(AppDomain.CurrentDomain.GetAssemblies(), asm => asm.FullName == args.Name);
if (firstAsm is not null) return firstAsm;
var guessFilename = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "dll", $"{new AssemblyName(args.Name).Name}.dll");
return File.Exists(guessFilename) ? Assembly.LoadFile(guessFilename) : null;
}
};
}
public static void Main() => RunTest();
private static void RunTest()
{
IGL igl = new IGL_TK(2, 0, false);
List<Art> testArts = new List<Art>();
ArtManager am = new ArtManager(igl);
@ -54,7 +68,7 @@ namespace BizHawk.Bizware.Test
rt.Bind();
igl.SetClearColor(Color.Blue);
igl.Clear(ClearBufferMask.ColorBufferBit);
gr.Begin(60, 60, true);
gr.Begin(60, 60);
gr.Draw(smile);
gr.End();
rt.Unbind();
@ -69,7 +83,7 @@ namespace BizHawk.Bizware.Test
RetroShader shader;
using (var stream = typeof(Program).Assembly.GetManifestResourceStream("BizHawk.Bizware.Test.TestImages.4xSoft.glsl"))
shader = new RetroShader(igl, new System.IO.StreamReader(stream).ReadToEnd());
igl.SetBlendState(igl.BlendNone);
igl.SetBlendState(igl.BlendNoneCopy);
shader.Run(rttex2d, new Size(60, 60), new Size(240, 240), true);
@ -103,15 +117,15 @@ namespace BizHawk.Bizware.Test
gr.SetModulateColor(Color.Green);
gr.RectFill(250, 0, 16, 16);
gr.SetBlendState(igl.BlendNone);
gr.SetBlendState(igl.BlendNoneCopy);
gr.Draw(rttex2d, 0, 20);
gr.SetBlendState(igl.BlendNormal);
sr.RenderString(gr, 0, 0, "?? fps");
gr.SetModulateColor(Color.FromArgb(255, 255, 255, 255));
gr.SetCornerColor(0, OpenTK.Graphics.Color4.Red);
gr.SetCornerColor(0, new(1.0f, 0.0f, 0.0f, 1.0f));
gr.Draw(rt2.Texture2d, 0, 0);
gr.SetCornerColor(0, OpenTK.Graphics.Color4.White);
gr.SetCornerColor(0, new(1.0f, 1.0f, 1.0f, 1.0f));
gr.SetModulateColorWhite();
gr.Modelview.Translate((float)Math.Sin(wobble / 360.0f) * 50, 0);
gr.Modelview.Translate(100, 100);

View File

@ -0,0 +1,6 @@
#!/bin/sh
set -e
cd "$(dirname "$0")"
dotnet build "$@"
cd bin
mono Test.exe