diff options
| -rw-r--r-- | demos/cube.c | 16 | ||||
| -rw-r--r-- | demos/tri.c | 14 | ||||
| -rw-r--r-- | demos/vulkaninfo.c | 7 |
3 files changed, 25 insertions, 12 deletions
diff --git a/demos/cube.c b/demos/cube.c index 99292358..645de5e2 100644 --- a/demos/cube.c +++ b/demos/cube.c @@ -24,6 +24,8 @@ #define DEMO_BUFFER_COUNT 2 #define DEMO_TEXTURE_COUNT 1 +#define APP_SHORT_NAME "cube" +#define APP_LONG_NAME "The Vulkan Cube Demo Program" #if defined(NDEBUG) && defined(__GNUC__) #define U_ASSERT_ONLY __attribute__((unused)) @@ -1630,7 +1632,13 @@ LRESULT CALLBACK WndProc(HWND hWnd, WPARAM wParam, LPARAM lParam) { +<<<<<<< HEAD char tmp_str[] = "Test Vulkan Cube Program"; +======= + PAINTSTRUCT paint_struct; + HDC hDC; // Device context + char tmp_str[] = APP_LONG_NAME; +>>>>>>> 7224550... demos: Use macros for the app name, and window name. switch(uMsg) { @@ -1822,9 +1830,9 @@ static void demo_init_vk(struct demo *demo) const VkApplicationInfo app = { .sType = VK_STRUCTURE_TYPE_APPLICATION_INFO, .pNext = NULL, - .pAppName = "cube", + .pAppName = APP_SHORT_NAME, .appVersion = 0, - .pEngineName = "cube", + .pEngineName = APP_SHORT_NAME, .engineVersion = 0, .apiVersion = VK_API_VERSION, }; @@ -1950,7 +1958,7 @@ static void demo_init(struct demo *demo, int argc, char **argv) #ifdef _WIN32 demo->connection = hInstance; - strncpy(demo->name, "cube", APP_NAME_STR_LEN); + strncpy(demo->name, APP_SHORT_NAME, APP_NAME_STR_LEN); if (strncmp(pCmdLine, "--use_staging", strlen("--use_staging")) == 0) demo->use_staging_buffer = true; @@ -1969,7 +1977,7 @@ static void demo_init(struct demo *demo, int argc, char **argv) } #endif // _WIN32 if (argv_error) { - fprintf(stderr, "Usage:\n cube [--use_staging]\n"); + fprintf(stderr, "Usage:\n %s [--use_staging]\n", APP_SHORT_NAME); fflush(stderr); exit(1); } diff --git a/demos/tri.c b/demos/tri.c index 61d034c9..9611a34c 100644 --- a/demos/tri.c +++ b/demos/tri.c @@ -50,6 +50,8 @@ #define DEMO_BUFFER_COUNT 2 #define DEMO_TEXTURE_COUNT 1 #define VERTEX_BUFFER_BIND_ID 0 +#define APP_SHORT_NAME "tri" +#define APP_LONG_NAME "The Vulkan Triangle Demo Program" #if defined(NDEBUG) && defined(__GNUC__) #define U_ASSERT_ONLY __attribute__((unused)) @@ -1199,7 +1201,9 @@ LRESULT CALLBACK WndProc(HWND hWnd, WPARAM wParam, LPARAM lParam) { - char tmp_str[] = "Test Vulkan Triangle Program"; + PAINTSTRUCT paint_struct; + HDC hDC; // Device context + char tmp_str[] = APP_LONG_NAME; switch(uMsg) { @@ -1370,9 +1374,9 @@ static void demo_init_vk(struct demo *demo) const VkApplicationInfo app = { .sType = VK_STRUCTURE_TYPE_APPLICATION_INFO, .pNext = NULL, - .pAppName = "tri", + .pAppName = APP_SHORT_NAME, .appVersion = 0, - .pEngineName = "tri", + .pEngineName = APP_SHORT_NAME, .engineVersion = 0, .apiVersion = VK_API_VERSION, }; @@ -1492,7 +1496,7 @@ static void demo_init(struct demo *demo, const int argc, const char *argv[]) #ifdef _WIN32 demo->connection = hInstance; - strncpy(demo->name, "tri", APP_NAME_STR_LEN); + strncpy(demo->name, APP_SHORT_NAME, APP_NAME_STR_LEN); if (strncmp(pCmdLine, "--use_staging", strlen("--use_staging")) == 0) demo->use_staging_buffer = true; @@ -1507,7 +1511,7 @@ static void demo_init(struct demo *demo, const int argc, const char *argv[]) } #endif // _WIN32 if (argv_error) { - fprintf(stderr, "Usage:\n tri [--use_staging]\n"); + fprintf(stderr, "Usage:\n %s [--use_staging]\n", APP_SHORT_NAME); fflush(stderr); exit(1); } diff --git a/demos/vulkaninfo.c b/demos/vulkaninfo.c index faf31f44..89dedadc 100644 --- a/demos/vulkaninfo.c +++ b/demos/vulkaninfo.c @@ -71,6 +71,7 @@ bool consoleCreated = false; #define MAX_GPUS 8 #define MAX_QUEUE_TYPES 5 +#define APP_SHORT_NAME "vulkaninfo" struct app_gpu; @@ -688,9 +689,9 @@ int main(int argc, char **argv) static const VkApplicationInfo app_info = { .sType = VK_STRUCTURE_TYPE_APPLICATION_INFO, .pNext = NULL, - .pAppName = "vkinfo", + .pAppName = APP_SHORT_NAME, .appVersion = 1, - .pEngineName = "vkinfo", + .pEngineName = APP_SHORT_NAME, .engineVersion = 1, .apiVersion = VK_API_VERSION, }; @@ -781,7 +782,7 @@ bool SetStdOutToNewConsole() return false; // change the console window title - if (!SetConsoleTitle(TEXT("vulkaninfo"))) + if (!SetConsoleTitle(TEXT(APP_SHORT_NAME))) return false; return true; |
