Skip to content

Commit

Permalink
NET 7.0 and SDL Impl
Browse files Browse the repository at this point in the history
  • Loading branch information
clibequilibrium committed Jan 18, 2023
1 parent 57948fe commit 696c9b7
Show file tree
Hide file tree
Showing 12 changed files with 201 additions and 112 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Building

```bash
dotnet restore src
dotnet build -c Release --no-restore src
```

# ImGui.NET

This is a .NET wrapper for the immediate mode GUI library, Dear ImGui (https://github.com/ocornut/imgui). ImGui.NET lets you build graphical interfaces using a simple immediate-mode style. ImGui.NET is a .NET Standard library, and can be used on all major .NET runtimes and operating systems.
Expand Down
Binary file modified deps/cimgui/win-x64/cimgui.dll
Binary file not shown.
95 changes: 0 additions & 95 deletions download-native-deps.ps1

This file was deleted.

3 changes: 2 additions & 1 deletion src/CodeGenerator/CodeGenerator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<Content Include="definitions\cimgui\structs_and_enums.json" CopyToOutputDirectory="PreserveNewest" />
<Content Include="definitions\cimgui\definitions.json" CopyToOutputDirectory="PreserveNewest" />
<Content Include="definitions\cimgui\variants.json" CopyToOutputDirectory="PreserveNewest" />
<Content Include="definitions\cimgui\impl_definitions.json" CopyToOutputDirectory="PreserveNewest" />

<Content Include="definitions\cimplot\structs_and_enums.json" CopyToOutputDirectory="PreserveNewest" />
<Content Include="definitions\cimplot\definitions.json" CopyToOutputDirectory="PreserveNewest" />
Expand Down
9 changes: 8 additions & 1 deletion src/CodeGenerator/ImguiDefinitions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ public void LoadFrom(string directory)
functionsJson = JObject.Load(jr);
}

JObject implFunctionsJson;
using (StreamReader fs = File.OpenText(Path.Combine(directory, "impl_definitions.json")))
using (JsonTextReader jr = new JsonTextReader(fs))
{
implFunctionsJson = JObject.Load(jr);
}

JObject variantsJson = null;
if (File.Exists(Path.Combine(directory, "variants.json")))
{
Expand Down Expand Up @@ -98,7 +105,7 @@ public void LoadFrom(string directory)
return new TypeDefinition(name, fields);
}).Where(x => x != null).ToArray();

Functions = functionsJson.Children().Select(jt =>
Functions = functionsJson.Children().Concat(implFunctionsJson.Children()).Select(jt =>
{
JProperty jp = (JProperty)jt;
string name = jp.Name;
Expand Down
21 changes: 11 additions & 10 deletions src/CodeGenerator/definitions/cimgui/definitions.json
Original file line number Diff line number Diff line change
Expand Up @@ -23339,7 +23339,7 @@
],
"igImQsort": [
{
"args": "(void* base,size_t count,size_t size_of_element,int(*compare_func)(void const*,void const*))",
"args": "(void* base,size_t count,size_t size_of_element,int(__cdecl*compare_func)(void const*,void const*))",
"argsT": [
{
"name": "base",
Expand All @@ -23354,21 +23354,22 @@
"type": "size_t"
},
{
"has_cdecl": "__cdecl",
"name": "compare_func",
"ret": "int",
"signature": "(void const*,void const*)",
"type": "int(*)(void const*,void const*)"
"type": "int(__cdecl*)(void const*,void const*)"
}
],
"argsoriginal": "(void* base,size_t count,size_t size_of_element,int(*compare_func)(void const*,void const*))",
"argsoriginal": "(void* base,size_t count,size_t size_of_element,int(__cdecl* compare_func)(void const*,void const*))",
"call_args": "(base,count,size_of_element,compare_func)",
"cimguiname": "igImQsort",
"defaults": {},
"funcname": "ImQsort",
"location": "imgui_internal:330",
"ov_cimguiname": "igImQsort",
"ret": "void",
"signature": "(void*,size_t,size_t,int(*)(void const*,void const*))",
"signature": "(void*,size_t,size_t,int(__cdecl*)(void const*,void const*))",
"stname": ""
}
],
Expand Down Expand Up @@ -23420,7 +23421,7 @@
"cimguiname": "igImRsqrt",
"defaults": {},
"funcname": "ImRsqrt",
"location": "imgui_internal:452",
"location": "imgui_internal:450",
"ov_cimguiname": "igImRsqrt_Float",
"ret": "float",
"signature": "(float)",
Expand Down Expand Up @@ -27711,7 +27712,7 @@
"type": "int"
}
],
"argsoriginal": "(const char* label,const float* values,int values_count,int values_offset=0,const char* overlay_text=((void*)0),float scale_min=3.40282346638528859811704183484516925e+38F,float scale_max=3.40282346638528859811704183484516925e+38F,ImVec2 graph_size=ImVec2(0,0),int stride=sizeof(float))",
"argsoriginal": "(const char* label,const float* values,int values_count,int values_offset=0,const char* overlay_text=((void*)0),float scale_min=3.40282347e+38F,float scale_max=3.40282347e+38F,ImVec2 graph_size=ImVec2(0,0),int stride=sizeof(float))",
"call_args": "(label,values,values_count,values_offset,overlay_text,scale_min,scale_max,graph_size,stride)",
"cimguiname": "igPlotHistogram",
"defaults": {
Expand Down Expand Up @@ -27772,7 +27773,7 @@
"type": "ImVec2"
}
],
"argsoriginal": "(const char* label,float(*values_getter)(void* data,int idx),void* data,int values_count,int values_offset=0,const char* overlay_text=((void*)0),float scale_min=3.40282346638528859811704183484516925e+38F,float scale_max=3.40282346638528859811704183484516925e+38F,ImVec2 graph_size=ImVec2(0,0))",
"argsoriginal": "(const char* label,float(*values_getter)(void* data,int idx),void* data,int values_count,int values_offset=0,const char* overlay_text=((void*)0),float scale_min=3.40282347e+38F,float scale_max=3.40282347e+38F,ImVec2 graph_size=ImVec2(0,0))",
"call_args": "(label,values_getter,data,values_count,values_offset,overlay_text,scale_min,scale_max,graph_size)",
"cimguiname": "igPlotHistogram",
"defaults": {
Expand Down Expand Up @@ -27832,7 +27833,7 @@
"type": "int"
}
],
"argsoriginal": "(const char* label,const float* values,int values_count,int values_offset=0,const char* overlay_text=((void*)0),float scale_min=3.40282346638528859811704183484516925e+38F,float scale_max=3.40282346638528859811704183484516925e+38F,ImVec2 graph_size=ImVec2(0,0),int stride=sizeof(float))",
"argsoriginal": "(const char* label,const float* values,int values_count,int values_offset=0,const char* overlay_text=((void*)0),float scale_min=3.40282347e+38F,float scale_max=3.40282347e+38F,ImVec2 graph_size=ImVec2(0,0),int stride=sizeof(float))",
"call_args": "(label,values,values_count,values_offset,overlay_text,scale_min,scale_max,graph_size,stride)",
"cimguiname": "igPlotLines",
"defaults": {
Expand Down Expand Up @@ -27893,7 +27894,7 @@
"type": "ImVec2"
}
],
"argsoriginal": "(const char* label,float(*values_getter)(void* data,int idx),void* data,int values_count,int values_offset=0,const char* overlay_text=((void*)0),float scale_min=3.40282346638528859811704183484516925e+38F,float scale_max=3.40282346638528859811704183484516925e+38F,ImVec2 graph_size=ImVec2(0,0))",
"argsoriginal": "(const char* label,float(*values_getter)(void* data,int idx),void* data,int values_count,int values_offset=0,const char* overlay_text=((void*)0),float scale_min=3.40282347e+38F,float scale_max=3.40282347e+38F,ImVec2 graph_size=ImVec2(0,0))",
"call_args": "(label,values_getter,data,values_count,values_offset,overlay_text,scale_min,scale_max,graph_size)",
"cimguiname": "igPlotLines",
"defaults": {
Expand Down Expand Up @@ -28147,7 +28148,7 @@
"type": "const char*"
}
],
"argsoriginal": "(float fraction,const ImVec2& size_arg=ImVec2(-1.17549435082228750796873653722224568e-38F,0),const char* overlay=((void*)0))",
"argsoriginal": "(float fraction,const ImVec2& size_arg=ImVec2(-1.17549435e-38F,0),const char* overlay=((void*)0))",
"call_args": "(fraction,size_arg,overlay)",
"cimguiname": "igProgressBar",
"defaults": {
Expand Down
Loading

0 comments on commit 696c9b7

Please sign in to comment.