Skip to content

Commit c57075b

Browse files
authored
Merge pull request #5 from thara/set_window_title
Support SDL_SetWindowTitle
2 parents 3f5b265 + a1c75e2 commit c57075b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Sources/SDL/Window.swift

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,21 @@ public final class SDLWindow {
110110
return SDL_SetWindowDisplayMode(internalPointer, nil) >= 0
111111
}
112112
}
113+
114+
/// Set the title of a window
115+
public var title: String {
116+
117+
get {
118+
119+
return String(cString: SDL_GetWindowTitle(internalPointer))
120+
121+
}
122+
set {
123+
124+
SDL_SetWindowTitle(internalPointer, newValue)
125+
126+
}
127+
}
113128
}
114129

115130
// MARK: - Supporting Types

0 commit comments

Comments
 (0)