Bläddra i källkod

texturec: Added version info.

Branimir Karadžić 8 år sedan
förälder
incheckning
5a7c9e4fc3

+ 2 - 0
include/bimg/bimg.h

@@ -9,6 +9,8 @@
 #include <stdint.h> // uint32_t
 #include <stdlib.h> // NULL
 
+#define BIMG_API_VERSION 1
+
 namespace bx
 {
 	struct AllocatorI;

+ 1 - 0
tools/bin/darwin/.gitignore

@@ -0,0 +1 @@
+*

+ 1 - 0
tools/bin/linux/.gitignore

@@ -0,0 +1 @@
+*

+ 1 - 0
tools/bin/windows/.gitignore

@@ -0,0 +1 @@
+*

+ 15 - 1
tools/texturec/texturec.cpp

@@ -384,6 +384,14 @@ bimg::ImageContainer* convert(bx::AllocatorI* _allocator, const void* _inputData
 	return output;
 }
 
+#define BIMG_TEXTUREC_VERSION_MAJOR 1
+#define BIMG_TEXTUREC_VERSION_MINOR 0
+
+#define BIMG_TEXTUREC_VERSION_STR                          \
+			     BX_STRINGIZE(BIMG_TEXTUREC_VERSION_MAJOR) \
+			"."  BX_STRINGIZE(BIMG_TEXTUREC_VERSION_MINOR) \
+			"."  BX_STRINGIZE(BIMG_API_VERSION)
+
 void help(const char* _error = NULL)
 {
 	if (NULL != _error)
@@ -392,7 +400,7 @@ void help(const char* _error = NULL)
 	}
 
 	fprintf(stderr
-		, "texturec, bgfx texture compiler tool\n"
+		, "texturec, bgfx texture compiler tool, version " BIMG_TEXTUREC_VERSION_STR "\n"
 		  "Copyright 2011-2017 Branimir Karadzic. All rights reserved.\n"
 		  "License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause\n\n"
 		);
@@ -430,6 +438,12 @@ int main(int _argc, const char* _argv[])
 {
 	bx::CommandLine cmdLine(_argc, _argv);
 
+	if (cmdLine.hasArg('v', "version") )
+	{
+		fprintf(stderr, "texturec, bgfx texture compiler tool, version " BIMG_TEXTUREC_VERSION_STR "\n");
+		return EXIT_SUCCESS;
+	}
+
 	if (cmdLine.hasArg('h', "help") )
 	{
 		help();