You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sdl/cmake/test/main.swift

13 lines
342 B
Swift

/* Contributed by Piotr Usewicz (https://github.com/pusewicz) */
import SDL2
guard SDL_Init(Uint32(SDL_INIT_VIDEO)) == 0 else {
fatalError("SDL_Init error: \(String(cString: SDL_GetError()))")
}
var sdlVersion = SDL_version()
SDL_GetVersion(&sdlVersion)
print("SDL version: \(sdlVersion.major).\(sdlVersion.minor).\(sdlVersion.patch)")