mirror of https://github.com/AxioDL/boo.git
Make Metal default graphics API for macOS
This commit is contained in:
parent
49d76b84be
commit
e0cabf9e1c
|
@ -92,15 +92,21 @@ public:
|
||||||
|
|
||||||
/* Determine which graphics API to use */
|
/* Determine which graphics API to use */
|
||||||
#if BOO_HAS_METAL
|
#if BOO_HAS_METAL
|
||||||
|
bool useGL = false;
|
||||||
for (const SystemString& arg : args)
|
for (const SystemString& arg : args)
|
||||||
if (!arg.compare("--metal"))
|
if (!arg.compare("--gl"))
|
||||||
{
|
{
|
||||||
m_metalCtx.m_dev = MTLCreateSystemDefaultDevice();
|
useGL = true;
|
||||||
m_metalCtx.m_q = [m_metalCtx.m_dev newCommandQueue];
|
|
||||||
Log.report(logvisor::Info, "using Metal renderer");
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!m_metalCtx.m_dev)
|
if (!useGL)
|
||||||
|
m_metalCtx.m_dev = MTLCreateSystemDefaultDevice();
|
||||||
|
if (m_metalCtx.m_dev)
|
||||||
|
{
|
||||||
|
m_metalCtx.m_q = [m_metalCtx.m_dev newCommandQueue];
|
||||||
|
Log.report(logvisor::Info, "using Metal renderer");
|
||||||
|
}
|
||||||
|
else
|
||||||
Log.report(logvisor::Info, "using OpenGL renderer");
|
Log.report(logvisor::Info, "using OpenGL renderer");
|
||||||
#else
|
#else
|
||||||
Log.report(logvisor::Info, "using OpenGL renderer");
|
Log.report(logvisor::Info, "using OpenGL renderer");
|
||||||
|
|
Loading…
Reference in New Issue