]> git.nega.tv - josh/narcissus/commitdiff
Add function to retreive sdl header version
authorJoshua Simmons <josh@nega.tv>
Sat, 19 Nov 2022 23:14:49 +0000 (00:14 +0100)
committerJoshua Simmons <josh@nega.tv>
Sat, 19 Nov 2022 23:14:49 +0000 (00:14 +0100)
ffi/sdl2-sys/src/lib.rs

index 38f3fc5bb7d54e62ce56483d84ec9548efad9936..5c0628d449aa146d4066b7d8772ebc9b4b60b419 100644 (file)
@@ -1226,6 +1226,16 @@ pub struct Version {
     pub patch: u8,
 }
 
+impl Version {
+    pub const fn current() -> Self {
+        Self {
+            major: MAJOR_VERSION,
+            minor: MINOR_VERSION,
+            patch: PATCH_VERSION,
+        }
+    }
+}
+
 #[repr(C)]
 pub enum SysWMType {
     UNKNOWN,