Skip to content

Commit d80ceb8

Browse files
authored
[3.0] SDL Bindings (#2207)
* Initial group codegen * Fix some trimming oddities * Fix HintTargetPGI and others similarly situated * Base typing and namespacing * Cast enum members, fix stray semicolons, Silk.NET.OpenGL builds again * Group and bool transformations * Fix erroneous cast order * Add Delete(singular) overloads (ArrayParameterOverloader) * Add SAL object model & Khronos length metadata parsing * ArrayParameterTransformer w/ tests * Integrate ArrayParameterTransformer * Support SupportedApiProfileAttribute generation with metadata * PrettifyNames conflict resolution now actually works * Fix casting transformation ambiguity bugs * Fix metadata retrieval for reserved identifiers * Fix unit tests * Fixup for all caps names * Fix naive trimming bug * More self-review comments * SDL bindings * Fix naming regression * Prettify & extract the nested _e__{Union,Struct,FixedBuffer} structs * Function pointer generation * Add a second pass to name delegates based on usage! * Fixes from self-review
1 parent efcd8e8 commit d80ceb8

File tree

389 files changed

+87512
-13067
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

389 files changed

+87512
-13067
lines changed

.config/dotnet-tools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
]
1010
}
1111
}
12-
}
12+
}

.gitmodules

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[submodule "submodules/terrafx.interop.windows"]
22
path = eng/submodules/terrafx.interop.windows
33
url = https://github.com/terrafx/terrafx.interop.windows
4-
[submodule "eng/submodules/glfw"]
5-
path = eng/submodules/glfw
6-
url = https://github.com/glfw/glfw
74
[submodule "eng/submodules/opengl"]
85
path = eng/submodules/opengl
96
url = https://github.com/KhronosGroup/OpenGL-Registry.git
107
[submodule "eng/submodules/egl"]
118
path = eng/submodules/egl
129
url = https://github.com/KhronosGroup/EGL-Registry/
10+
[submodule "eng/submodules/sdl"]
11+
path = eng/submodules/sdl
12+
url = https://github.com/libsdl-org/SDL

Silk.NET.sln

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,13 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Silk.NET.SilkTouch", "sourc
4848
EndProject
4949
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Silk.NET.SilkTouch.UnitTests", "tests\SilkTouch\Silk.NET.SilkTouch.UnitTests.csproj", "{600D712C-4ABF-44C4-96C3-B1DEE1F38298}"
5050
EndProject
51-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Silk.NET.GLFW", "sources\GLFW\Silk.NET.GLFW.csproj", "{7B58E4E1-0DE6-453C-95A2-25D8EE0621C1}"
52-
EndProject
5351
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "eng", "eng", "{475AEF7B-0154-4989-AF82-97E3A95A96AF}"
5452
EndProject
5553
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Silk.NET.Core", "sources\Core\Silk.NET.Core.csproj", "{131C09C1-BF4D-47C1-AF13-4A7E30866B1E}"
5654
EndProject
5755
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Playground", "sources\Playground\Playground.csproj", "{48F43535-3AFC-45E7-A98D-C2609B3B9757}"
5856
EndProject
59-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Silk.NET.Core.UnitTests", "tests\Silk.NET.Core.UnitTests\Silk.NET.Core.UnitTests.csproj", "{A87E1861-07E4-4B7A-9173-0853370A7D4E}"
57+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Silk.NET.Core.UnitTests", "tests\Core\Silk.NET.Core.UnitTests.csproj", "{A87E1861-07E4-4B7A-9173-0853370A7D4E}"
6058
EndProject
6159
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Silk.NET.Maths", "sources\Maths\Silk.NET.Maths.csproj", "{1B21D783-71C3-48D3-91F5-0EEA90FB0DB2}"
6260
EndProject
@@ -68,6 +66,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Silk.NET.Maths.Benchmarks",
6866
EndProject
6967
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Silk.NET.OpenGL", "sources\OpenGL\Silk.NET.OpenGL.csproj", "{9625C977-25BE-48F3-9B6F-BC94B8B799A6}"
7068
EndProject
69+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Silk.NET.SDL", "sources\SDL\Silk.NET.SDL.csproj", "{19B05730-F97E-43D4-B922-DF4697E5CE5F}"
70+
EndProject
71+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Silk.NET.SDL.UnitTests", "tests\SDL\Silk.NET.SDL.UnitTests.csproj", "{D2B9C43F-A80D-4C9A-9643-BC1AC1B4E807}"
72+
EndProject
7173
Global
7274
GlobalSection(SolutionConfigurationPlatforms) = preSolution
7375
Debug|Any CPU = Debug|Any CPU
@@ -82,10 +84,6 @@ Global
8284
{600D712C-4ABF-44C4-96C3-B1DEE1F38298}.Debug|Any CPU.Build.0 = Debug|Any CPU
8385
{600D712C-4ABF-44C4-96C3-B1DEE1F38298}.Release|Any CPU.ActiveCfg = Release|Any CPU
8486
{600D712C-4ABF-44C4-96C3-B1DEE1F38298}.Release|Any CPU.Build.0 = Release|Any CPU
85-
{7B58E4E1-0DE6-453C-95A2-25D8EE0621C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
86-
{7B58E4E1-0DE6-453C-95A2-25D8EE0621C1}.Debug|Any CPU.Build.0 = Debug|Any CPU
87-
{7B58E4E1-0DE6-453C-95A2-25D8EE0621C1}.Release|Any CPU.ActiveCfg = Release|Any CPU
88-
{7B58E4E1-0DE6-453C-95A2-25D8EE0621C1}.Release|Any CPU.Build.0 = Release|Any CPU
8987
{131C09C1-BF4D-47C1-AF13-4A7E30866B1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
9088
{131C09C1-BF4D-47C1-AF13-4A7E30866B1E}.Debug|Any CPU.Build.0 = Debug|Any CPU
9189
{131C09C1-BF4D-47C1-AF13-4A7E30866B1E}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -114,14 +112,21 @@ Global
114112
{9625C977-25BE-48F3-9B6F-BC94B8B799A6}.Debug|Any CPU.Build.0 = Debug|Any CPU
115113
{9625C977-25BE-48F3-9B6F-BC94B8B799A6}.Release|Any CPU.ActiveCfg = Release|Any CPU
116114
{9625C977-25BE-48F3-9B6F-BC94B8B799A6}.Release|Any CPU.Build.0 = Release|Any CPU
115+
{19B05730-F97E-43D4-B922-DF4697E5CE5F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
116+
{19B05730-F97E-43D4-B922-DF4697E5CE5F}.Debug|Any CPU.Build.0 = Debug|Any CPU
117+
{19B05730-F97E-43D4-B922-DF4697E5CE5F}.Release|Any CPU.ActiveCfg = Release|Any CPU
118+
{19B05730-F97E-43D4-B922-DF4697E5CE5F}.Release|Any CPU.Build.0 = Release|Any CPU
119+
{D2B9C43F-A80D-4C9A-9643-BC1AC1B4E807}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
120+
{D2B9C43F-A80D-4C9A-9643-BC1AC1B4E807}.Debug|Any CPU.Build.0 = Debug|Any CPU
121+
{D2B9C43F-A80D-4C9A-9643-BC1AC1B4E807}.Release|Any CPU.ActiveCfg = Release|Any CPU
122+
{D2B9C43F-A80D-4C9A-9643-BC1AC1B4E807}.Release|Any CPU.Build.0 = Release|Any CPU
117123
EndGlobalSection
118124
GlobalSection(SolutionProperties) = preSolution
119125
HideSolutionNode = FALSE
120126
EndGlobalSection
121127
GlobalSection(NestedProjects) = preSolution
122128
{76F747A6-D971-4162-BF35-A226177FCA08} = {DD29EA8F-B1A6-45AA-8D2E-B38DA56D9EF6}
123129
{600D712C-4ABF-44C4-96C3-B1DEE1F38298} = {A5578D12-9E77-4647-8C22-0DBD17760BFF}
124-
{7B58E4E1-0DE6-453C-95A2-25D8EE0621C1} = {DD29EA8F-B1A6-45AA-8D2E-B38DA56D9EF6}
125130
{131C09C1-BF4D-47C1-AF13-4A7E30866B1E} = {DD29EA8F-B1A6-45AA-8D2E-B38DA56D9EF6}
126131
{48F43535-3AFC-45E7-A98D-C2609B3B9757} = {DD29EA8F-B1A6-45AA-8D2E-B38DA56D9EF6}
127132
{A87E1861-07E4-4B7A-9173-0853370A7D4E} = {A5578D12-9E77-4647-8C22-0DBD17760BFF}
@@ -130,6 +135,8 @@ Global
130135
{B681E21A-47A2-4635-96EE-60D8D63FBEA9} = {475AEF7B-0154-4989-AF82-97E3A95A96AF}
131136
{AF6C70ED-D6A8-4C57-8DB3-EAFF94396049} = {B681E21A-47A2-4635-96EE-60D8D63FBEA9}
132137
{9625C977-25BE-48F3-9B6F-BC94B8B799A6} = {DD29EA8F-B1A6-45AA-8D2E-B38DA56D9EF6}
138+
{19B05730-F97E-43D4-B922-DF4697E5CE5F} = {DD29EA8F-B1A6-45AA-8D2E-B38DA56D9EF6}
139+
{D2B9C43F-A80D-4C9A-9643-BC1AC1B4E807} = {A5578D12-9E77-4647-8C22-0DBD17760BFF}
133140
EndGlobalSection
134141
GlobalSection(ExtensibilityGlobals) = postSolution
135142
SolutionGuid = {78D2CF6A-60A1-43E3-837B-00B73C9DA384}

eng/silktouch/glfw/glfw3/generate.rsp

Lines changed: 0 additions & 16 deletions
This file was deleted.

eng/silktouch/glfw/glfw3/glfw-glfw3.h

Lines changed: 0 additions & 1 deletion
This file was deleted.

eng/silktouch/glfw/glfw3/header.txt

Lines changed: 0 additions & 5 deletions
This file was deleted.

eng/silktouch/glfw/remap.rsp

Lines changed: 0 additions & 2 deletions
This file was deleted.

eng/silktouch/sdl/SDL3/generate.rsp

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
@../settings.rsp
2+
@../remap.rsp
3+
--exclude
4+
SDL_SetX11EventHook
5+
SDL_FUNCTION
6+
SDL_SIZE_MAX
7+
SDL_memcpy
8+
SDL_memmove
9+
SDL_memset
10+
--file
11+
sdl-SDL.h
12+
--methodClassName
13+
Sdl
14+
--namespace
15+
Silk.NET.SDL
16+
--output
17+
../../../../sources/SDL/SDL3
18+
--test-output
19+
../../../../tests/SDL/SDL3
20+
--traverse
21+
../../../submodules/sdl/include/SDL3/SDL_assert.h
22+
../../../submodules/sdl/include/SDL3/SDL_atomic.h
23+
../../../submodules/sdl/include/SDL3/SDL_audio.h
24+
../../../submodules/sdl/include/SDL3/SDL_blendmode.h
25+
../../../submodules/sdl/include/SDL3/SDL_camera.h
26+
../../../submodules/sdl/include/SDL3/SDL_clipboard.h
27+
../../../submodules/sdl/include/SDL3/SDL_cpuinfo.h
28+
../../../submodules/sdl/include/SDL3/SDL_dialog.h
29+
../../../submodules/sdl/include/SDL3/SDL_error.h
30+
../../../submodules/sdl/include/SDL3/SDL_events.h
31+
../../../submodules/sdl/include/SDL3/SDL_filesystem.h
32+
../../../submodules/sdl/include/SDL3/SDL_gamepad.h
33+
../../../submodules/sdl/include/SDL3/SDL_guid.h
34+
../../../submodules/sdl/include/SDL3/SDL_haptic.h
35+
../../../submodules/sdl/include/SDL3/SDL_hidapi.h
36+
../../../submodules/sdl/include/SDL3/SDL_hints.h
37+
../../../submodules/sdl/include/SDL3/SDL_init.h
38+
../../../submodules/sdl/include/SDL3/SDL_iostream.h
39+
../../../submodules/sdl/include/SDL3/SDL_joystick.h
40+
../../../submodules/sdl/include/SDL3/SDL_keyboard.h
41+
../../../submodules/sdl/include/SDL3/SDL_keycode.h
42+
../../../submodules/sdl/include/SDL3/SDL_loadso.h
43+
../../../submodules/sdl/include/SDL3/SDL_locale.h
44+
../../../submodules/sdl/include/SDL3/SDL_log.h
45+
../../../submodules/sdl/include/SDL3/SDL_messagebox.h
46+
../../../submodules/sdl/include/SDL3/SDL_metal.h
47+
../../../submodules/sdl/include/SDL3/SDL_misc.h
48+
../../../submodules/sdl/include/SDL3/SDL_mouse.h
49+
../../../submodules/sdl/include/SDL3/SDL_mutex.h
50+
../../../submodules/sdl/include/SDL3/SDL_pen.h
51+
../../../submodules/sdl/include/SDL3/SDL_pixels.h
52+
../../../submodules/sdl/include/SDL3/SDL_platform.h
53+
../../../submodules/sdl/include/SDL3/SDL_power.h
54+
../../../submodules/sdl/include/SDL3/SDL_properties.h
55+
../../../submodules/sdl/include/SDL3/SDL_rect.h
56+
../../../submodules/sdl/include/SDL3/SDL_render.h
57+
../../../submodules/sdl/include/SDL3/SDL_scancode.h
58+
../../../submodules/sdl/include/SDL3/SDL_sensor.h
59+
../../../submodules/sdl/include/SDL3/SDL_storage.h
60+
../../../submodules/sdl/include/SDL3/SDL_surface.h
61+
../../../submodules/sdl/include/SDL3/SDL_system.h
62+
../../../submodules/sdl/include/SDL3/SDL_thread.h
63+
../../../submodules/sdl/include/SDL3/SDL_time.h
64+
../../../submodules/sdl/include/SDL3/SDL_timer.h
65+
../../../submodules/sdl/include/SDL3/SDL_touch.h
66+
../../../submodules/sdl/include/SDL3/SDL_version.h
67+
../../../submodules/sdl/include/SDL3/SDL_video.h

eng/silktouch/sdl/SDL3/header.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
4+
// Ported from SDL.h and corresponding dependencies of SDL3.
5+
// Original source is Copyright (C) 1997-2024 Sam Lantinga. Licensed under the zlib license.

eng/silktouch/sdl/SDL3/sdl-SDL.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#include <SDL3/SDL.h>

0 commit comments

Comments
 (0)