Changed struct syntax
This commit is contained in:
parent
de7893cb25
commit
49079fcc57
1 changed files with 16 additions and 14 deletions
28
src/main.c
28
src/main.c
|
|
@ -12,24 +12,26 @@ typedef struct Application {
|
|||
} Application;
|
||||
|
||||
void createInstance(Application *app) {
|
||||
VkApplicationInfo appInfo;
|
||||
appInfo.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO;
|
||||
appInfo.pApplicationName = "Hello Triangle";
|
||||
appInfo.applicationVersion = VK_MAKE_VERSION(1, 0, 0);
|
||||
appInfo.pEngineName = "No Engine";
|
||||
appInfo.engineVersion = VK_MAKE_VERSION(1, 0, 0);
|
||||
appInfo.apiVersion = VK_API_VERSION_1_0;
|
||||
VkApplicationInfo appInfo = {
|
||||
.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO,
|
||||
.pApplicationName = "Hello Triangle",
|
||||
.applicationVersion = VK_MAKE_VERSION(1, 0, 0),
|
||||
.pEngineName = "No Engine",
|
||||
.engineVersion = VK_MAKE_VERSION(1, 0, 0),
|
||||
.apiVersion = VK_API_VERSION_1_0,
|
||||
};
|
||||
|
||||
uint32_t glfwExtensionCount = 0;
|
||||
const char **glfwExtensions;
|
||||
glfwExtensions = glfwGetRequiredInstanceExtensions(&glfwExtensionCount);
|
||||
|
||||
VkInstanceCreateInfo createInfo;
|
||||
createInfo.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
|
||||
createInfo.pApplicationInfo = &appInfo;
|
||||
createInfo.enabledExtensionCount = glfwExtensionCount;
|
||||
createInfo.ppEnabledExtensionNames = glfwExtensions;
|
||||
createInfo.enabledLayerCount = 0;
|
||||
VkInstanceCreateInfo createInfo = {
|
||||
.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO,
|
||||
.pApplicationInfo = &appInfo,
|
||||
.enabledExtensionCount = glfwExtensionCount,
|
||||
.ppEnabledExtensionNames = glfwExtensions,
|
||||
.enabledLayerCount = 0,
|
||||
};
|
||||
|
||||
VkResult result = vkCreateInstance(&createInfo, NULL, &app->instance);
|
||||
if (result != VK_SUCCESS) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue