demo->frameCount = INT32_MAX;
/* Autodetect suitable / best GPU by default */
demo->gpu_number = -1;
+ demo->width = 500;
+ demo->height = 500;
for (int i = 1; i < argc; i++) {
if (strcmp(argv[i], "--use_staging") == 0) {
i++;
continue;
}
+ if (strcmp(argv[i], "--width") == 0 && i < argc - 1 && sscanf(argv[i + 1], "%d", &demo->width) == 1 && demo->width > 0) {
+ i++;
+ continue;
+ }
+ if (strcmp(argv[i], "--height") == 0 && i < argc - 1 && sscanf(argv[i + 1], "%d", &demo->height) == 1 && demo->height > 0) {
+ i++;
+ continue;
+ }
if (strcmp(argv[i], "--suppress_popups") == 0) {
demo->suppress_popups = true;
continue;
"\t[--incremental_present] [--display_timing]\n"
"\t[--gpu_number <index of physical device>]\n"
"\t[--present_mode <present mode enum>]\n"
+ "\t[--width <width>] [--height <height>]\n"
"\t<present_mode_enum>\n"
"\t\tVK_PRESENT_MODE_IMMEDIATE_KHR = %d\n"
"\t\tVK_PRESENT_MODE_MAILBOX_KHR = %d\n"
demo_init_vk(demo);
- demo->width = 500;
- demo->height = 500;
-
demo->spin_angle = 4.0f;
demo->spin_increment = 0.2f;
demo->pause = false;
presentMode = vk::PresentModeKHR::eFifo;
frameCount = UINT32_MAX;
+ width = 500;
+ height = 500;
use_xlib = false;
/* Autodetect suitable / best GPU by default */
gpu_number = -1;
i++;
continue;
}
+ if (strcmp(argv[i], "--width") == 0 && i < argc - 1 && sscanf(argv[i + 1], "%" SCNu32, &width) == 1 && width > 0) {
+ i++;
+ continue;
+ }
+ if (strcmp(argv[i], "--height") == 0 && i < argc - 1 && sscanf(argv[i + 1], "%" SCNu32, &height) == 1 && height > 0) {
+ i++;
+ continue;
+ }
if (strcmp(argv[i], "--suppress_popups") == 0) {
suppress_popups = true;
continue;
<< "\t[--break] [--c <framecount>] [--suppress_popups]\n"
<< "\t[--gpu_number <index of physical device>]\n"
<< "\t[--present_mode <present mode enum>]\n"
+ << "\t[--width <width>] [--height <height>]\n"
<< "\t<present_mode_enum>\n"
<< "\t\tVK_PRESENT_MODE_IMMEDIATE_KHR = " << VK_PRESENT_MODE_IMMEDIATE_KHR << "\n"
<< "\t\tVK_PRESENT_MODE_MAILBOX_KHR = " << VK_PRESENT_MODE_MAILBOX_KHR << "\n"
init_vk();
- width = 500;
- height = 500;
-
spin_angle = 4.0f;
spin_increment = 0.2f;
pause = false;