HelloTriangle.h

#pragma once

It’s a header…


#include <vulkan/Application.h>

Needed because HelloTriangle is derived from vulkan::Application.

class HelloTriangle : public vulkan::Application
{
 public:
  std::u8string application_name() const override
  {
    return u8"Hello Triangle";
  }
};

All the default virtual functions of vulkan::Application are good for this “hello world” application, except that default "Application Name", noone can live with that.

Note:

The following virtual functions of vulkan::Application allow further configuration of the application:

  • std::string default_display_name() const The default DISPLAY name to use (can be overridden by parse_command_line_parameters) (default: ":0").

  • int thread_pool_number_of_worker_threads() const The number of worker threads to use for the thread pool (default: vulkan::Application::default_number_of_threads which is 8).

  • int thread_pool_queue_capacity(QueuePriority priority) const The size of the thread pool queues (default: equal to the number of worker threads).

  • int thread_pool_reserved_threads(QueuePriority priority) const The number of reserved threads for each queue (default: vulkan::Application::default_reserved_threads which is 1).

  • void prepare_instance_info(vulkan::InstanceCreateInfo& instance_create_info) const Override this function to add Instance layers and/or extensions.

  • std::u8string application_name() const
    Override this function to change the default ApplicationInfo values (default: "Application Name").

  • uint32_t application_version() const
    Override this function to change the default application version. The result should be a value returned by vk_utils::encode_version (default: vk_utils::encode_version(0, 0, 0)).