Files
2024-10-24 18:29:07 -04:00

20 lines
465 B
Swift

import CSDL3
public class Window {
let handle: OpaquePointer
public init(_ title: String, width: Int, height: Int, shown: Bool) throws {
handle = try SDL_CreateWindow(
title,
Int32(width), Int32(height),
0 // TODO - impl window flags
).sdlThrow(type: type(of: self))
}
deinit {
SDL_DestroyWindow(handle)
}
public var renderer: Renderer { get throws { try Renderer(self) } }
}