diff options
author | 2015-11-01 20:30:24 +0100 | |
---|---|---|
committer | 2015-11-01 20:30:24 +0100 | |
commit | 5664971d3bf57ad7e1a7a3138f788f714c0d7d74 (patch) | |
tree | f64fdaa35a890c4c7052f5fd173b3d0d3668a4ed /3rdparty/bgfx/examples/common/bgfx_utils.cpp | |
parent | 99c12e17c40fecb16e1ef0dc2fae0d45a86def59 (diff) |
update to latest BGFX and BX
Diffstat (limited to '3rdparty/bgfx/examples/common/bgfx_utils.cpp')
-rw-r--r-- | 3rdparty/bgfx/examples/common/bgfx_utils.cpp | 59 |
1 files changed, 58 insertions, 1 deletions
diff --git a/3rdparty/bgfx/examples/common/bgfx_utils.cpp b/3rdparty/bgfx/examples/common/bgfx_utils.cpp index 386062c065d..b1897c8f592 100644 --- a/3rdparty/bgfx/examples/common/bgfx_utils.cpp +++ b/3rdparty/bgfx/examples/common/bgfx_utils.cpp @@ -13,8 +13,9 @@ namespace stl = tinystl; #include <bgfx/bgfx.h> -#include <bx/readerwriter.h> +#include <bx/commandline.h> #include <bx/fpumath.h> +#include <bx/readerwriter.h> #include <bx/string.h> #include "entry/entry.h" #include <ib-compress/indexbufferdecompression.h> @@ -621,3 +622,59 @@ void meshSubmit(const Mesh* _mesh, const MeshState*const* _state, uint8_t _numPa { _mesh->submit(_state, _numPasses, _mtx, _numMatrices); } + +Args::Args(int _argc, char** _argv) + : m_type(bgfx::RendererType::Count) + , m_pciId(BGFX_PCI_ID_NONE) +{ + bx::CommandLine cmdLine(_argc, (const char**)_argv); + + if (cmdLine.hasArg("gl") ) + { + m_type = bgfx::RendererType::OpenGL; + } + else if (cmdLine.hasArg("noop") + || cmdLine.hasArg("vk") ) + { + m_type = bgfx::RendererType::OpenGL; + } + else if (BX_ENABLED(BX_PLATFORM_WINDOWS) ) + { + if (cmdLine.hasArg("d3d9") ) + { + m_type = bgfx::RendererType::Direct3D9; + } + else if (cmdLine.hasArg("d3d11") ) + { + m_type = bgfx::RendererType::Direct3D11; + } + else if (cmdLine.hasArg("d3d12") ) + { + m_type = bgfx::RendererType::Direct3D12; + } + } + else if (BX_ENABLED(BX_PLATFORM_OSX) ) + { + if (cmdLine.hasArg("mtl") ) + { + m_type = bgfx::RendererType::Metal; + } + } + + if (cmdLine.hasArg("amd") ) + { + m_pciId = BGFX_PCI_ID_AMD; + } + else if (cmdLine.hasArg("nvidia") ) + { + m_pciId = BGFX_PCI_ID_NVIDIA; + } + else if (cmdLine.hasArg("intel") ) + { + m_pciId = BGFX_PCI_ID_INTEL; + } + else if (cmdLine.hasArg("sw") ) + { + m_pciId = BGFX_PCI_ID_SOFTWARE_RASTERIZER; + } +} |