diff --git a/base/vulkanexamplebase.cpp b/base/vulkanexamplebase.cpp index cdcece9a..287b3295 100644 --- a/base/vulkanexamplebase.cpp +++ b/base/vulkanexamplebase.cpp @@ -565,16 +565,28 @@ void VulkanExampleBase::submitFrame() VulkanExampleBase::VulkanExampleBase(bool enableValidation) { // Parse command line arguments - for (auto arg : args) + for (size_t i = 0; i < args.size(); i++) { - if (arg == std::string("-validation")) + if (args[i] == std::string("-validation")) { this->enableValidation = true; } - if (arg == std::string("-vsync")) + if (args[i] == std::string("-vsync")) { enableVSync = true; } + if ((args[i] == std::string("-w")) || (args[i] == std::string("-width"))) + { + char* endptr; + uint32_t w = strtol(args[i + 1], &endptr, 10); + if (endptr != args[i + 1]) { width = w; }; + } + if ((args[i] == std::string("-h")) || (args[i] == std::string("-height"))) + { + char* endptr; + uint32_t h = strtol(args[i + 1], &endptr, 10); + if (endptr != args[i + 1]) { height = h; }; + } } #if defined(__ANDROID__) // Vulkan library is loaded dynamically on Android @@ -591,7 +603,7 @@ VulkanExampleBase::VulkanExampleBase(bool enableValidation) // Debug message callback will output to it if (this->enableValidation) { - setupConsole("VulkanExample"); + setupConsole("Vulkan validation output"); } #endif } diff --git a/occlusionquery/occlusionquery.cpp b/occlusionquery/occlusionquery.cpp index c9d98448..8464dac5 100644 --- a/occlusionquery/occlusionquery.cpp +++ b/occlusionquery/occlusionquery.cpp @@ -91,8 +91,6 @@ public: VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) { - width = 1280; - height = 720; zoom = -35.0f; zoomSpeed = 2.5f; rotationSpeed = 0.5f; diff --git a/pushconstants/pushconstants.cpp b/pushconstants/pushconstants.cpp index 4254ac06..d932a9b1 100644 --- a/pushconstants/pushconstants.cpp +++ b/pushconstants/pushconstants.cpp @@ -68,8 +68,6 @@ public: VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) { - width = 1280; - height = 720; zoom = -30.0; zoomSpeed = 2.5f; rotationSpeed = 0.5f; diff --git a/triangle/triangle.cpp b/triangle/triangle.cpp index 545b7c34..e708ff85 100644 --- a/triangle/triangle.cpp +++ b/triangle/triangle.cpp @@ -114,8 +114,6 @@ public: VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) { - width = 1280; - height = 720; zoom = -2.5f; title = "Vulkan Example - Basic indexed triangle"; // Values not set here are initialized in the base class constructor diff --git a/vulkanscene/vulkanscene.cpp b/vulkanscene/vulkanscene.cpp index 1622ad39..171bf14e 100644 --- a/vulkanscene/vulkanscene.cpp +++ b/vulkanscene/vulkanscene.cpp @@ -93,8 +93,6 @@ public: VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) { - width = 1280; - height = 720; zoom = -3.75f; rotationSpeed = 0.5f; rotation = glm::vec3(15.0f, 0.f, 0.0f);