Merge branch 'master' of github.com:bkaradzic/bgfx

This commit is contained in:
Branimir Karadžić 2017-06-20 22:28:37 -07:00
commit 9d1df47f09
5 changed files with 33 additions and 33 deletions

View File

@ -403,7 +403,7 @@ namespace entry
if (!glfwInit() ) if (!glfwInit() )
{ {
DBG("glfwInit failed!"); DBG("glfwInit failed!");
return EXIT_FAILURE; return bx::kExitFailure;
} }
glfwSetJoystickCallback(joystickCb); glfwSetJoystickCallback(joystickCb);
@ -422,7 +422,7 @@ namespace entry
{ {
DBG("glfwCreateWindow failed!"); DBG("glfwCreateWindow failed!");
glfwTerminate(); glfwTerminate();
return EXIT_FAILURE; return bx::kExitFailure;
} }
glfwSetKeyCallback(m_windows[0], keyCb); glfwSetKeyCallback(m_windows[0], keyCb);

View File

@ -2326,7 +2326,7 @@ namespace bgfx
BGFX_PROFILER_SET_CURRENT_THREAD_NAME("bgfx - Render Thread"); BGFX_PROFILER_SET_CURRENT_THREAD_NAME("bgfx - Render Thread");
while (RenderFrame::Exiting != bgfx::renderFrame() ) {}; while (RenderFrame::Exiting != bgfx::renderFrame() ) {};
BX_TRACE("render thread exit"); BX_TRACE("render thread exit");
return EXIT_SUCCESS; return bx::kExitSuccess;
} }
// game thread // game thread

View File

@ -423,27 +423,27 @@ int main(int _argc, const char* _argv[])
, BGFX_GEOMETRYC_VERSION_MINOR , BGFX_GEOMETRYC_VERSION_MINOR
, BGFX_API_VERSION , BGFX_API_VERSION
); );
return EXIT_SUCCESS; return bx::kExitSuccess;
} }
if (cmdLine.hasArg('h', "help") ) if (cmdLine.hasArg('h', "help") )
{ {
help(); help();
return EXIT_FAILURE; return bx::kExitFailure;
} }
const char* filePath = cmdLine.findOption('f'); const char* filePath = cmdLine.findOption('f');
if (NULL == filePath) if (NULL == filePath)
{ {
help("Input file name must be specified."); help("Input file name must be specified.");
return EXIT_FAILURE; return bx::kExitFailure;
} }
const char* outFilePath = cmdLine.findOption('o'); const char* outFilePath = cmdLine.findOption('o');
if (NULL == outFilePath) if (NULL == outFilePath)
{ {
help("Output file name must be specified."); help("Output file name must be specified.");
return EXIT_FAILURE; return bx::kExitFailure;
} }
float scale = 1.0f; float scale = 1.0f;
@ -473,7 +473,7 @@ int main(int _argc, const char* _argv[])
if (NULL == file) if (NULL == file)
{ {
printf("Unable to open input file '%s'.", filePath); printf("Unable to open input file '%s'.", filePath);
exit(EXIT_FAILURE); exit(bx::kExitFailure);
} }
int64_t parseElapsed = -bx::getHPCounter(); int64_t parseElapsed = -bx::getHPCounter();
@ -845,7 +845,7 @@ int main(int _argc, const char* _argv[])
if (!bx::open(&writer, outFilePath) ) if (!bx::open(&writer, outFilePath) )
{ {
printf("Unable to open output file '%s'.", outFilePath); printf("Unable to open output file '%s'.", outFilePath);
exit(EXIT_FAILURE); exit(bx::kExitFailure);
} }
Primitive prim; Primitive prim;
@ -1062,5 +1062,5 @@ int main(int _argc, const char* _argv[])
, numIndices , numIndices
); );
return EXIT_SUCCESS; return bx::kExitSuccess;
} }

View File

@ -793,13 +793,13 @@ namespace bgfx
, BGFX_SHADERC_VERSION_MINOR , BGFX_SHADERC_VERSION_MINOR
, BGFX_API_VERSION , BGFX_API_VERSION
); );
return EXIT_SUCCESS; return bx::kExitSuccess;
} }
if (cmdLine.hasArg('h', "help") ) if (cmdLine.hasArg('h', "help") )
{ {
help(); help();
return EXIT_FAILURE; return bx::kExitFailure;
} }
g_verbose = cmdLine.hasArg("verbose"); g_verbose = cmdLine.hasArg("verbose");
@ -808,21 +808,21 @@ namespace bgfx
if (NULL == filePath) if (NULL == filePath)
{ {
help("Shader file name must be specified."); help("Shader file name must be specified.");
return EXIT_FAILURE; return bx::kExitFailure;
} }
const char* outFilePath = cmdLine.findOption('o'); const char* outFilePath = cmdLine.findOption('o');
if (NULL == outFilePath) if (NULL == outFilePath)
{ {
help("Output file name must be specified."); help("Output file name must be specified.");
return EXIT_FAILURE; return bx::kExitFailure;
} }
const char* type = cmdLine.findOption('\0', "type"); const char* type = cmdLine.findOption('\0', "type");
if (NULL == type) if (NULL == type)
{ {
help("Must specify shader type."); help("Must specify shader type.");
return EXIT_FAILURE; return bx::kExitFailure;
} }
const char* platform = cmdLine.findOption('\0', "platform"); const char* platform = cmdLine.findOption('\0', "platform");
@ -1045,7 +1045,7 @@ namespace bgfx
default: default:
fprintf(stderr, "Unknown type: %s?!", type); fprintf(stderr, "Unknown type: %s?!", type);
return EXIT_FAILURE; return bx::kExitFailure;
} }
bool compiled = false; bool compiled = false;
@ -1244,7 +1244,7 @@ namespace bgfx
if (!bx::open(writer, outFilePath) ) if (!bx::open(writer, outFilePath) )
{ {
fprintf(stderr, "Unable to open output file '%s'.", outFilePath); fprintf(stderr, "Unable to open output file '%s'.", outFilePath);
return EXIT_FAILURE; return bx::kExitFailure;
} }
if ('f' == shaderType) if ('f' == shaderType)
@ -1381,13 +1381,13 @@ namespace bgfx
if (!bx::open(&writer, outFilePath) ) if (!bx::open(&writer, outFilePath) )
{ {
fprintf(stderr, "Unable to open output file '%s'.", outFilePath); fprintf(stderr, "Unable to open output file '%s'.", outFilePath);
return EXIT_FAILURE; return bx::kExitFailure;
} }
bx::write(&writer, preprocessor.m_preprocessed.c_str(), (int32_t)preprocessor.m_preprocessed.size() ); bx::write(&writer, preprocessor.m_preprocessed.c_str(), (int32_t)preprocessor.m_preprocessed.size() );
bx::close(&writer); bx::close(&writer);
return EXIT_SUCCESS; return bx::kExitSuccess;
} }
{ {
@ -1405,7 +1405,7 @@ namespace bgfx
if (!bx::open(writer, outFilePath) ) if (!bx::open(writer, outFilePath) )
{ {
fprintf(stderr, "Unable to open output file '%s'.", outFilePath); fprintf(stderr, "Unable to open output file '%s'.", outFilePath);
return EXIT_FAILURE; return bx::kExitFailure;
} }
bx::write(writer, BGFX_CHUNK_MAGIC_CSH); bx::write(writer, BGFX_CHUNK_MAGIC_CSH);
@ -1689,7 +1689,7 @@ namespace bgfx
else else
{ {
fprintf(stderr, "gl_PrimitiveID builtin is not supported by this D3D9 HLSL.\n"); fprintf(stderr, "gl_PrimitiveID builtin is not supported by this D3D9 HLSL.\n");
return EXIT_FAILURE; return bx::kExitFailure;
} }
} }
@ -1779,7 +1779,7 @@ namespace bgfx
else else
{ {
fprintf(stderr, "gl_VertexID builtin is not supported by this D3D9 HLSL.\n"); fprintf(stderr, "gl_VertexID builtin is not supported by this D3D9 HLSL.\n");
return EXIT_FAILURE; return bx::kExitFailure;
} }
} }
@ -1795,7 +1795,7 @@ namespace bgfx
else else
{ {
fprintf(stderr, "gl_InstanceID builtin is not supported by this D3D9 HLSL.\n"); fprintf(stderr, "gl_InstanceID builtin is not supported by this D3D9 HLSL.\n");
return EXIT_FAILURE; return bx::kExitFailure;
} }
} }
@ -1851,7 +1851,7 @@ namespace bgfx
if (!bx::open(&writer, outFilePath) ) if (!bx::open(&writer, outFilePath) )
{ {
fprintf(stderr, "Unable to open output file '%s'.", outFilePath); fprintf(stderr, "Unable to open output file '%s'.", outFilePath);
return EXIT_FAILURE; return bx::kExitFailure;
} }
if (0 != glsl) if (0 != glsl)
@ -1868,7 +1868,7 @@ namespace bgfx
bx::write(&writer, preprocessor.m_preprocessed.c_str(), (int32_t)preprocessor.m_preprocessed.size() ); bx::write(&writer, preprocessor.m_preprocessed.c_str(), (int32_t)preprocessor.m_preprocessed.size() );
bx::close(&writer); bx::close(&writer);
return EXIT_SUCCESS; return bx::kExitSuccess;
} }
{ {
@ -1886,7 +1886,7 @@ namespace bgfx
if (!bx::open(writer, outFilePath) ) if (!bx::open(writer, outFilePath) )
{ {
fprintf(stderr, "Unable to open output file '%s'.", outFilePath); fprintf(stderr, "Unable to open output file '%s'.", outFilePath);
return EXIT_FAILURE; return bx::kExitFailure;
} }
if ('f' == shaderType) if ('f' == shaderType)
@ -2189,13 +2189,13 @@ namespace bgfx
if (compiled) if (compiled)
{ {
return EXIT_SUCCESS; return bx::kExitSuccess;
} }
remove(outFilePath); remove(outFilePath);
fprintf(stderr, "Failed to build shader.\n"); fprintf(stderr, "Failed to build shader.\n");
return EXIT_FAILURE; return bx::kExitFailure;
} }
} // namespace bgfx } // namespace bgfx

View File

@ -753,18 +753,18 @@ int _main_(int _argc, char** _argv)
, BGFX_TEXTUREV_VERSION_MINOR , BGFX_TEXTUREV_VERSION_MINOR
, BGFX_API_VERSION , BGFX_API_VERSION
); );
return EXIT_SUCCESS; return bx::kExitSuccess;
} }
if (cmdLine.hasArg('h', "help") ) if (cmdLine.hasArg('h', "help") )
{ {
help(); help();
return EXIT_FAILURE; return bx::kExitFailure;
} }
else if (cmdLine.hasArg("associate") ) else if (cmdLine.hasArg("associate") )
{ {
associate(); associate();
return EXIT_FAILURE; return bx::kExitFailure;
} }
uint32_t width = 1280; uint32_t width = 1280;
@ -878,12 +878,12 @@ int _main_(int _argc, char** _argv)
view.updateFileList(path.c_str() ); view.updateFileList(path.c_str() );
} }
int exitcode = EXIT_SUCCESS; int exitcode = bx::kExitSuccess;
bgfx::TextureHandle texture = BGFX_INVALID_HANDLE; bgfx::TextureHandle texture = BGFX_INVALID_HANDLE;
if (view.m_fileList.empty() ) if (view.m_fileList.empty() )
{ {
exitcode = EXIT_FAILURE; exitcode = bx::kExitFailure;
if (2 > _argc) if (2 > _argc)
{ {
help("File path is not specified."); help("File path is not specified.");