Skip to content

Commit 4659d43

Browse files
committed
Add project files.
1 parent f15deeb commit 4659d43

24 files changed

+13777
-0
lines changed

Generator/Generator.csproj

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net8.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<PackageReference Include="HexaGen" Version="1.1.11" />
12+
</ItemGroup>
13+
14+
<ItemGroup>
15+
<None Update="generator.json">
16+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
17+
</None>
18+
<None Update="include\al.h">
19+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
20+
</None>
21+
<None Update="include\alc.h">
22+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
23+
</None>
24+
<None Update="include\alext.h">
25+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
26+
</None>
27+
<None Update="include\efx-creative.h">
28+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
29+
</None>
30+
<None Update="include\efx-presets.h">
31+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
32+
</None>
33+
<None Update="include\efx.h">
34+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
35+
</None>
36+
<None Update="include\main.h">
37+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
38+
</None>
39+
</ItemGroup>
40+
</Project>

Generator/Program.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// See https://aka.ms/new-console-template for more information
2+
using HexaGen;
3+
using HexaGen.Patching;
4+
5+
CsCodeGeneratorConfig config = CsCodeGeneratorConfig.Load("generator.json");
6+
CsCodeGenerator generator = new(config);
7+
generator.PatchEngine.RegisterPrePatch(new NamingPatch(["Alc", "Al"], NamingPatchOptions.None));
8+
generator.LogToConsole();
9+
generator.Generate(["include/main.h"], "../../../../Hexa.NET.OpenAL/Generated");

Generator/generator.json

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"Namespace": "Hexa.NET.OpenAL",
3+
"ApiName": "OpenAL",
4+
"LibName": "OpenAL32",
5+
"ImportType": "FunctionTable",
6+
"GenerateSizeOfStructs": false,
7+
"GenerateMetadata": true,
8+
"NameMappings": {
9+
"LPEFXEAXREVERBPROPERTIES": "LPEFXEAXReverbProperties",
10+
"EFXEAXREVERBPROPERTIES": "EFXEAXReverbProperties"
11+
},
12+
"TypeMappings": {
13+
"uint8_t": "byte",
14+
"uint16_t": "ushort",
15+
"uint32_t": "uint",
16+
"uint64_t": "ulong",
17+
"int8_t": "sbyte",
18+
"int32_t": "int",
19+
"int16_t": "short",
20+
"int64_t": "long",
21+
"int64_t*": "long*",
22+
"unsigned char": "byte",
23+
"signed char": "sbyte",
24+
"char": "byte",
25+
"size_t": "nuint",
26+
"bool": "bool",
27+
"ALboolean": "byte",
28+
"ALchar": "byte",
29+
"ALbyte": "sbyte",
30+
"ALubyte": "byte",
31+
"ALshort": "short",
32+
"ALushort": "ushort",
33+
"ALint": "int",
34+
"ALuint": "uint",
35+
"ALsizei": "int",
36+
"ALenum": "int",
37+
"ALfloat": "float",
38+
"ALdouble": "double",
39+
"ALvoid": "void",
40+
"ALint64SOFT": "long",
41+
"ALuint64SOFT": "ulong",
42+
"ALCboolean": "byte",
43+
"ALCchar": "byte",
44+
"ALCbyte": "sbyte",
45+
"ALCubyte": "byte",
46+
"ALCshort": "short",
47+
"ALCushort": "ushort",
48+
"ALCint": "int",
49+
"ALCuint": "uint",
50+
"ALCsizei": "int",
51+
"ALCenum": "int",
52+
"ALCfloat": "float",
53+
"ALCdouble": "double",
54+
"ALCvoid": "void",
55+
"ALCint64SOFT": "long",
56+
"ALCuint64SOFT": "ulong"
57+
}
58+
}

0 commit comments

Comments
 (0)