SDL/cmake/test/main.swift
2024-07-27 17:13:52 +02:00

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)")