Skip to content

Commit aecc848

Browse files
authored
Merge branch 'master' into add-VtxOffset-handling
2 parents 12ff7a9 + e416f8c commit aecc848

Some content is hidden

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

47 files changed

+7434
-2865
lines changed

.github/workflows/build.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: CI
2+
on:
3+
create: # when tags are created
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
jobs:
9+
Build_Windows:
10+
runs-on: windows-latest
11+
steps:
12+
- name: Checkout Repository
13+
uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 0
16+
17+
- name: Install .NET
18+
uses: actions/setup-dotnet@v1
19+
with:
20+
dotnet-version: 6.0.x
21+
- name: Restore dependencies
22+
run: dotnet restore src
23+
- name: Build Project
24+
run: dotnet build -c Release --no-restore src
25+
26+
- name: Build Packages
27+
run: dotnet pack src/ImGui.NET -c Release --no-restore --no-build
28+
- name: List Packages
29+
run: ls -l bin\Release\ImGui.NET\
30+
31+
- name: Publish to nuget.org
32+
if: startsWith(github.ref, 'refs/tags/')
33+
run: dotnet nuget push bin\Release\ImGui.NET\*.nupkg -s https://api.nuget.org/v3/index.json --api-key ${{secrets.NUGET_KEY}}

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,16 @@ ImGui.NET can be built in Visual Studio or on the command line. The .NET Core SD
1616

1717
# Usage
1818

19-
ImGui.NET currently provides a raw wrapper around the ImGui native API, and also provides a very thin safe, managed API for convenience. It is currently very much like using the native library, which is very simple, flexible, and robust. The easiest way to figure out how to use the library is to read the documentation of imgui itself, mostly in the imgui.cpp, and imgui.h files, as well as the exported functions in cimgui.h. Looking at the sample program code will also give some indication about basic usage.
19+
ImGui.NET currently provides a raw wrapper around the ImGui native API, and also provides a very thin safe, managed API for convenience. It is currently very much like using the native library, which is very simple, flexible, and robust. The easiest way to figure out how to use the library is to read the documentation of imgui itself, mostly in the imgui.cpp, and imgui.h files, as well as the exported functions in cimgui.h. Looking at the [sample program code](https://github.com/mellinoe/ImGui.NET/tree/master/src) will also give some indication about basic usage.
20+
21+
# Debugging native code
22+
23+
ImGui.NET is a wrapper over native code. By default, this native code is packaged and released in an optimized form, making debugging difficult. To obtain a debuggable version of the native code, follow these steps:
24+
25+
1. Clone the [ImGui.NET-nativebuild](https://github.com/mellinoe/ImGui.NET-nativebuild) repo, at the tag matching the version of ImGui.NET you are using.
26+
2. In the ImGui.NET-nativebuild repo, run `build.cmd debug` or `build.sh debug` (depending on your platform).
27+
3. Copy the produced binaries (cimgui.dll, libcimgui.so, or libcimgui.dylib) into your application.
28+
4. Run the program under a native debugger, or enable mixed-mode debugging in Visual Studio.
2029

2130
# See Also
2231

deps/cimgui/linux-x64/cimgui.so

85.4 KB
Binary file not shown.
2.18 MB
Binary file not shown.

deps/cimgui/osx-x64/cimgui.dylib

-1.06 MB
Binary file not shown.

deps/cimgui/win-x64/cimgui.dll

57.5 KB
Binary file not shown.

deps/cimgui/win-x86/cimgui.dll

63 KB
Binary file not shown.

download-native-deps.ps1

100644100755
Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,29 @@
11
param (
2+
[Parameter(Mandatory=$false)][string]$repository,
23
[Parameter(Mandatory=$true)][string]$tag
34
)
45

6+
if( -not $repository )
7+
{
8+
$repository="https://github.com/mellinoe/imgui.net-nativebuild"
9+
}
10+
511
Write-Host Downloading native binaries from GitHub Releases...
612

713
if (Test-Path $PSScriptRoot\deps\cimgui\)
814
{
915
Remove-Item $PSScriptRoot\deps\cimgui\ -Force -Recurse | Out-Null
1016
}
1117
New-Item -ItemType Directory -Force -Path $PSScriptRoot\deps\cimgui\linux-x64 | Out-Null
12-
New-Item -ItemType Directory -Force -Path $PSScriptRoot\deps\cimgui\osx-x64 | Out-Null
18+
New-Item -ItemType Directory -Force -Path $PSScriptRoot\deps\cimgui\osx-universal | Out-Null
1319
New-Item -ItemType Directory -Force -Path $PSScriptRoot\deps\cimgui\win-x86 | Out-Null
1420
New-Item -ItemType Directory -Force -Path $PSScriptRoot\deps\cimgui\win-x64 | Out-Null
1521

1622
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
1723

1824
$client = New-Object System.Net.WebClient
1925
$client.DownloadFile(
20-
"https://github.com/mellinoe/imgui.net-nativebuild/releases/download/$tag/cimgui.win-x86.dll",
26+
"$repository/releases/download/$tag/cimgui.win-x86.dll",
2127
"$PSScriptRoot/deps/cimgui/win-x86/cimgui.dll")
2228
if( -not $? )
2329
{
@@ -29,7 +35,7 @@ if( -not $? )
2935
Write-Host "- cimgui.dll (x86)"
3036

3137
$client.DownloadFile(
32-
"https://github.com/mellinoe/imgui.net-nativebuild/releases/download/$tag/cimgui.win-x64.dll",
38+
"$repository/releases/download/$tag/cimgui.win-x64.dll",
3339
"$PSScriptRoot/deps/cimgui/win-x64/$configuration/cimgui.dll")
3440
if( -not $? )
3541
{
@@ -41,7 +47,7 @@ if( -not $? )
4147
Write-Host "- cimgui.dll (x64)"
4248

4349
$client.DownloadFile(
44-
"https://github.com/mellinoe/imgui.net-nativebuild/releases/download/$tag/cimgui.so",
50+
"$repository/releases/download/$tag/cimgui.so",
4551
"$PSScriptRoot/deps/cimgui/linux-x64/cimgui.so")
4652
if( -not $? )
4753
{
@@ -53,13 +59,37 @@ if( -not $? )
5359
Write-Host - cimgui.so
5460

5561
$client.DownloadFile(
56-
"https://github.com/mellinoe/imgui.net-nativebuild/releases/download/$tag/cimgui.dylib",
57-
"$PSScriptRoot/deps/cimgui/osx-x64/cimgui.dylib")
62+
"$repository/releases/download/$tag/cimgui.dylib",
63+
"$PSScriptRoot/deps/cimgui/osx-universal/cimgui.dylib")
5864
if( -not $? )
5965
{
6066
$msg = $Error[0].Exception.Message
6167
Write-Error "Couldn't download cimgui.dylib. This most likely indicates the macOS native build failed."
6268
exit
6369
}
6470

65-
Write-Host - cimgui.dylib
71+
Write-Host "- cimgui.dylib"
72+
73+
$client.DownloadFile(
74+
"https://github.com/mellinoe/imgui.net-nativebuild/releases/download/$tag/definitions.json",
75+
"$PSScriptRoot/src/CodeGenerator/definitions/cimgui/definitions.json")
76+
if( -not $? )
77+
{
78+
$msg = $Error[0].Exception.Message
79+
Write-Error "Couldn't download definitions.json."
80+
exit
81+
}
82+
83+
Write-Host - definitions.json
84+
85+
$client.DownloadFile(
86+
"https://github.com/mellinoe/imgui.net-nativebuild/releases/download/$tag/structs_and_enums.json",
87+
"$PSScriptRoot/src/CodeGenerator/definitions/cimgui/structs_and_enums.json")
88+
if( -not $? )
89+
{
90+
$msg = $Error[0].Exception.Message
91+
Write-Error "Couldn't download structs_and_enums.json."
92+
exit
93+
}
94+
95+
Write-Host - structs_and_enums.json

download-native-deps.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/usr/bin/env bash
2+
3+
if [ $# -eq 0 ]; then
4+
echo "Missing first argument. Please provide the tag to download."
5+
exit 1
6+
fi
7+
8+
TAG=$1
9+
10+
SCRIPT_ROOT=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
11+
12+
echo "Script is located in: $SCRIPT_ROOT"
13+
echo "Using Tag: $TAG"
14+
15+
echo -n "Downloading windows x86 cimgui: "
16+
curl -sfLo "$SCRIPT_ROOT/deps/cimgui/win-x86/cimgui.dll" "https://github.com/mellinoe/imgui.net-nativebuild/releases/download/$TAG/cimgui.win-x86.dll"
17+
echo ""
18+
19+
echo -n "Downloading windows x64 cimgui: "
20+
curl -sfLo "$SCRIPT_ROOT/deps/cimgui/win-x64/cimgui.dll" "https://github.com/mellinoe/imgui.net-nativebuild/releases/download/$TAG/cimgui.win-x64.dll"
21+
echo ""
22+
23+
echo -n "Downloading linux x64 cimgui: "
24+
curl -sfLo "$SCRIPT_ROOT/deps/cimgui/linux-x64/cimgui.so" "https://github.com/mellinoe/imgui.net-nativebuild/releases/download/$TAG/cimgui.so"
25+
echo ""
26+
27+
echo -n "Downloading osx x64 cimgui: "
28+
curl -sfLo "$SCRIPT_ROOT/deps/cimgui/osx-x64/cimgui.dylib" "https://github.com/mellinoe/imgui.net-nativebuild/releases/download/$TAG/cimgui.dylib"
29+
echo ""
30+
31+
echo -n "Downloading definitions json file: "
32+
curl -sfLo "$SCRIPT_ROOT/src/CodeGenerator/definitions/cimgui/definitions.json" "https://github.com/mellinoe/imgui.net-nativebuild/releases/download/$TAG/definitions.json"
33+
echo ""
34+
35+
echo -n "Downloading structs and enums json file: "
36+
curl -sfLo "$SCRIPT_ROOT/src/CodeGenerator/definitions/cimgui/structs_and_enums.json" "https://github.com/mellinoe/imgui.net-nativebuild/releases/download/$TAG/structs_and_enums.json"
37+
echo ""

src/CodeGenerator/CodeGenerator.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
<TargetFramework>net6.0</TargetFramework>
66
</PropertyGroup>
77

88
<ItemGroup>

0 commit comments

Comments
 (0)