Skip to content

Commit

Permalink
Add project files.
Browse files Browse the repository at this point in the history
  • Loading branch information
JunaMeinhold committed Oct 28, 2024
1 parent f15deeb commit 4659d43
Show file tree
Hide file tree
Showing 24 changed files with 13,777 additions and 0 deletions.
40 changes: 40 additions & 0 deletions Generator/Generator.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="HexaGen" Version="1.1.11" />
</ItemGroup>

<ItemGroup>
<None Update="generator.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="include\al.h">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="include\alc.h">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="include\alext.h">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="include\efx-creative.h">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="include\efx-presets.h">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="include\efx.h">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="include\main.h">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
9 changes: 9 additions & 0 deletions Generator/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// See https://aka.ms/new-console-template for more information
using HexaGen;
using HexaGen.Patching;

CsCodeGeneratorConfig config = CsCodeGeneratorConfig.Load("generator.json");
CsCodeGenerator generator = new(config);
generator.PatchEngine.RegisterPrePatch(new NamingPatch(["Alc", "Al"], NamingPatchOptions.None));
generator.LogToConsole();
generator.Generate(["include/main.h"], "../../../../Hexa.NET.OpenAL/Generated");
58 changes: 58 additions & 0 deletions Generator/generator.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"Namespace": "Hexa.NET.OpenAL",
"ApiName": "OpenAL",
"LibName": "OpenAL32",
"ImportType": "FunctionTable",
"GenerateSizeOfStructs": false,
"GenerateMetadata": true,
"NameMappings": {
"LPEFXEAXREVERBPROPERTIES": "LPEFXEAXReverbProperties",
"EFXEAXREVERBPROPERTIES": "EFXEAXReverbProperties"
},
"TypeMappings": {
"uint8_t": "byte",
"uint16_t": "ushort",
"uint32_t": "uint",
"uint64_t": "ulong",
"int8_t": "sbyte",
"int32_t": "int",
"int16_t": "short",
"int64_t": "long",
"int64_t*": "long*",
"unsigned char": "byte",
"signed char": "sbyte",
"char": "byte",
"size_t": "nuint",
"bool": "bool",
"ALboolean": "byte",
"ALchar": "byte",
"ALbyte": "sbyte",
"ALubyte": "byte",
"ALshort": "short",
"ALushort": "ushort",
"ALint": "int",
"ALuint": "uint",
"ALsizei": "int",
"ALenum": "int",
"ALfloat": "float",
"ALdouble": "double",
"ALvoid": "void",
"ALint64SOFT": "long",
"ALuint64SOFT": "ulong",
"ALCboolean": "byte",
"ALCchar": "byte",
"ALCbyte": "sbyte",
"ALCubyte": "byte",
"ALCshort": "short",
"ALCushort": "ushort",
"ALCint": "int",
"ALCuint": "uint",
"ALCsizei": "int",
"ALCenum": "int",
"ALCfloat": "float",
"ALCdouble": "double",
"ALCvoid": "void",
"ALCint64SOFT": "long",
"ALCuint64SOFT": "ulong"
}
}
Loading

0 comments on commit 4659d43

Please sign in to comment.