diff options
author | dan sinclair <dj2@everburning.com> | 2019-01-15 10:42:30 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-15 10:42:30 -0500 |
commit | 39af1036672c700d59410633f4b2383542d478a0 (patch) | |
tree | f2985410d35567b3e11da8cb0ef87782d0fb6a78 /samples | |
parent | c3617ae73c77b4a520d9987fa71b0d4a9ca4d7c0 (diff) | |
download | amber-39af1036672c700d59410633f4b2383542d478a0.tar.gz |
Convert API to C++03 from C++11 for CTS compatibility (#218)
The CTS requires code to not use c++11. This CL converts the various
c++11-ism's in the Amber API to C++03.
Diffstat (limited to 'samples')
-rw-r--r-- | samples/amber.cc | 10 | ||||
-rw-r--r-- | samples/config_helper.cc | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/samples/amber.cc b/samples/amber.cc index 7d150fc..4d772ab 100644 --- a/samples/amber.cc +++ b/samples/amber.cc @@ -37,7 +37,7 @@ struct Options { bool show_summary = false; bool show_help = false; bool show_version_info = false; - amber::EngineType engine = amber::EngineType::kVulkan; + amber::EngineType engine = amber::kEngineTypeVulkan; }; const char kUsage[] = R"(Usage: amber [options] SCRIPT [SCRIPTS...] @@ -94,9 +94,9 @@ bool ParseArgs(const std::vector<std::string>& args, Options* opts) { } const std::string& engine = args[i]; if (engine == "vulkan") { - opts->engine = amber::EngineType::kVulkan; + opts->engine = amber::kEngineTypeVulkan; } else if (engine == "dawn") { - opts->engine = amber::EngineType::kDawn; + opts->engine = amber::kEngineTypeDawn; } else { std::cerr << "Invalid value for -e argument. Must be one of: vulkan dawn" @@ -238,13 +238,15 @@ int main(int argc, const char** argv) { } sample::ConfigHelper config_helper; - amber_options.config = config_helper.CreateConfig( + auto config = config_helper.CreateConfig( amber_options.engine, std::vector<std::string>(required_features.begin(), required_features.end()), std::vector<std::string>(required_extensions.begin(), required_extensions.end())); + amber_options.config = config.get(); + for (const auto& recipe_data_elem : recipe_data) { const auto* recipe = recipe_data_elem.recipe.get(); const auto& file = recipe_data_elem.file; diff --git a/samples/config_helper.cc b/samples/config_helper.cc index 677e945..9487210 100644 --- a/samples/config_helper.cc +++ b/samples/config_helper.cc @@ -38,7 +38,7 @@ std::unique_ptr<amber::EngineConfig> ConfigHelper::CreateConfig( amber::EngineType engine, const std::vector<std::string>& required_features, const std::vector<std::string>& required_extensions) { - if (engine == amber::EngineType::kDawn) + if (engine == amber::kEngineTypeDawn) return nullptr; #if AMBER_ENGINE_VULKAN |