Window size as arguments (Fixes #270)
This commit is contained in:
parent
8d3fe738c3
commit
792d8347be
5 changed files with 16 additions and 12 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue