Browse Source

Added API version to simple example

Fredrik Hultin 6 years ago
parent
commit
8333083498
1 changed files with 7 additions and 0 deletions
  1. 7 0
      examples/simple/simple.c

+ 7 - 0
examples/simple/simple.c

@@ -42,6 +42,13 @@ int main(int argc, char** argv)
 	if(argc > 1)
 		device_idx = atoi(argv[1]);
 
+	ohmd_require_version(0, 3, 0);
+
+	int major, minor, patch;
+	ohmd_get_version(&major, &minor, &patch);
+
+	printf("OpenHMD version: %d.%d.%d\n", major, minor, patch);
+
 	ohmd_context* ctx = ohmd_ctx_create();
 
 	// Probe for devices