From 1a48dd9c42cd25030281345831e7cfb2359426bd Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Tue, 9 Jan 2018 21:10:08 -1000 Subject: [PATCH] macOS build fixes --- lib/mac/ApplicationCocoa.mm | 5 ++++- test/main.cpp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/mac/ApplicationCocoa.mm b/lib/mac/ApplicationCocoa.mm index 814c9f2..758ae44 100644 --- a/lib/mac/ApplicationCocoa.mm +++ b/lib/mac/ApplicationCocoa.mm @@ -65,6 +65,7 @@ public: SystemStringView friendlyName, SystemStringView pname, const std::vector& args, + std::string_view gfxApi, uint32_t samples, uint32_t anisotropy) : m_callback(callback), @@ -103,6 +104,8 @@ public: /* Determine which graphics API to use */ #if BOO_HAS_METAL bool useGL = false; + if (!gfxApi.compare("OpenGL")) + useGL = true; for (const SystemString& arg : args) if (!arg.compare("--gl")) { @@ -237,7 +240,7 @@ int ApplicationRun(IApplication::EPlatformType platform, platform != IApplication::EPlatformType::Auto) return 1; /* Never deallocated to ensure window destructors have access */ - APP = new ApplicationCocoa(cb, uniqueName, friendlyName, pname, args, samples, anisotropy); + APP = new ApplicationCocoa(cb, uniqueName, friendlyName, pname, args, gfxApi, samples, anisotropy); } [NSApp run]; ApplicationCocoa* appCocoa = static_cast(APP); diff --git a/test/main.cpp b/test/main.cpp index b24c216..9e6a1be 100644 --- a/test/main.cpp +++ b/test/main.cpp @@ -466,7 +466,7 @@ struct TestApplicationCallback : IApplicationCallback " return tex.sample(samp, d.out_uv);\n" "}\n"; - pipeline = metalF.newShaderPipeline(VS, FS, nullptr, nullptr, vfmt, 1, + pipeline = metalF.newShaderPipeline(VS, FS, nullptr, nullptr, vfmt, BlendFactor::One, BlendFactor::Zero, Primitive::TriStrips, boo::ZTest::LEqual, true, true, true, boo::CullMode::None); } else