Start of generate vectors for C#

This commit is contained in:
Simon Lübeß
2023-07-19 18:43:26 +02:00
parent 6e02a04a4f
commit f0de874572
12 changed files with 815 additions and 112 deletions
@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace ScriptCore.Math.Attributes;
public class VectorAttribute : Attribute
{
public Type Type { get; set; }
public int ComponentCount { get; set; }
public string TypeBase { get; set; }
public VectorAttribute(Type type, int componentCount, string typeBase)
{
Type = type;
ComponentCount = componentCount;
TypeBase = typeBase;
}
}
public class SwizzleVectorAttribute : Attribute
{
public SwizzleVectorAttribute()
{
}
}
+22
View File
@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Text;
using GlitchyEngine.Math;
using ScriptCore.Math.Attributes;
namespace GlitchyEngine.Math;
[Vector(typeof(float), 2, "float")]
public partial struct float2
{
}
[Vector(typeof(float), 3, "float")]
public partial struct float3
{
}
[Vector(typeof(float), 4, "float")]
public partial struct float4
{
}
+5
View File
@@ -4,10 +4,15 @@
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>latest</LangVersion>
<BaseOutputPath></BaseOutputPath>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
</PropertyGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="PowerShell ./postbuild.ps1 -sourceDir $(OutDir) -destinationDir &quot;..\GlitchyEditor\resources\scripts&quot;" />
</Target>
<ItemGroup>
<ProjectReference Include="..\ScriptCoreGenerator\ScriptCoreGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>
</Project>