Skip to content

Commit f350c3b

Browse files
committed
Merge branch 'release/1.78' into master
2 parents d395b5d + 28f6fd7 commit f350c3b

18 files changed

Lines changed: 2438 additions & 1651 deletions

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import PackageDescription
3838
let package = Package(
3939
name: "YourPackageName",
4040
dependencies: [
41-
.package(url: "https://github.com/ctreffs/SwiftImGui.git", from: "1.77.0")
41+
.package(url: "https://github.com/ctreffs/SwiftImGui.git", from: "1.78.0")
4242
],
4343
targets: [
4444
.target(
@@ -75,7 +75,7 @@ for n in 0..<20 {
7575
ImGuiNewFrame()
7676
var f: Float = 0.0
7777
ImGuiTextV("Hello, world!")
78-
ImGuiSliderFloat("float", &f, 0.0, 1.0, "", 1)
78+
ImGuiSliderFloat("float", &f, 0.0, 1.0, nil, 1)
7979
ImGuiTextV("Application average %.3f ms/frame (%.1f FPS)", 1000.0 / io.pointee.Framerate, io.pointee.Framerate)
8080
ImGuiShowDemoWindow(nil)
8181
ImGuiRender()

‎Sources/AutoWrapper/ArgT.swift‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public struct ArgsT: Decodable {
8686
case let .custom(name) where name.hasSuffix("Callback") && escapedName.contains("callback"):
8787
return "_ \(escapedName): @escaping \(self.type.toString(.argSwift))"
8888
default:
89-
return "_ \(escapedName): \(self.type.toString(.argSwift))"
89+
return "_ \(escapedName): \(self.type.toString(.argSwift, defaultArg: true))"
9090
}
9191
}
9292
}

‎Sources/AutoWrapper/DataType.swift‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ public struct DataType: Decodable {
186186
}
187187
}
188188

189-
public func toString(_ context: Context, wrapped: Bool = true) -> String {
189+
public func toString(_ context: Context, wrapped: Bool = true, defaultArg: Bool = false) -> String {
190190
let out: String
191191

192192
switch type {
@@ -198,6 +198,8 @@ public struct DataType: Decodable {
198198
out = "Int32"
199199
case .uint:
200200
out = "UInt32"
201+
case .char where meta == .pointer && defaultArg && isConst:
202+
out = "String? = nil"
201203
case .char where meta == .pointer:
202204
out = "String?"
203205
case .char:

‎Sources/AutoWrapper/Exceptions.swift‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ public enum Exceptions {
3030
"ImVector_size",
3131
"ImVector_size_in_bytes",
3232
"ImVector_swap",
33-
"igImFontAtlasBuildMultiplyRectAlpha8",
3433
"igImFontAtlasBuildMultiplyCalcLookupTable",
34+
"igImFontAtlasBuildMultiplyRectAlpha8",
35+
"igImFontAtlasBuildRender1bppRectFromString",
3536
"igImTriangleBarycentricCoords"
3637
]
3738

‎Sources/AutoWrapper/FunctionBodyRenderer.swift‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,15 +126,15 @@ struct FunctionBodyRenderer {
126126
case .pointer where arg.type.type == .char && arg.type.isConst == true:
127127
// const char*
128128
return [
129-
.preLine("\(arg.escapedName)!.withCString { \(arg.name)Ptr in"),
129+
.preLine("\(arg.escapedName).withOptionalCString { \(arg.name)Ptr in"),
130130
.line("\(arg.name)Ptr"),
131131
.postLine("}")
132132
]
133133

134134
case .pointer where arg.type.type == .char && arg.type.isConst == false:
135135
// char*
136136
return [
137-
.preLine("\(arg.escapedName)!.withCString { \(arg.name)Ptr in"),
137+
.preLine("\(arg.escapedName).withOptionalCString { \(arg.name)Ptr in"),
138138
.line("UnsafeMutablePointer(mutating: \(arg.name)Ptr)"),
139139
.postLine("}")
140140
]

‎Sources/CImGui/cimgui.cpp‎

Lines changed: 107 additions & 67 deletions
Large diffs are not rendered by default.

‎Sources/CImGui/imgui/imgui.cpp‎

Lines changed: 244 additions & 140 deletions
Large diffs are not rendered by default.

‎Sources/CImGui/imgui/imgui.h‎

Lines changed: 142 additions & 77 deletions
Large diffs are not rendered by default.

‎Sources/CImGui/imgui/imgui_demo.cpp‎

Lines changed: 360 additions & 223 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)