You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.0 KiB
40 lines
1.0 KiB
#include <vulkan/vulkan.h>
|
|
#include <vulkan/vulkan_core.h>
|
|
#include <assert.h>
|
|
|
|
#include "vulkan.hpp"
|
|
|
|
#include "glfw.hpp"
|
|
#include "window.hpp"
|
|
|
|
namespace ls {
|
|
VulkanState::VulkanState(GlfwState* state) {
|
|
VkApplicationInfo application_info = {
|
|
VK_STRUCTURE_TYPE_APPLICATION_INFO,
|
|
NULL,
|
|
"Game",
|
|
VK_MAKE_VERSION( 1, 0, 0 ),
|
|
"LightningStrike",
|
|
VK_MAKE_VERSION( 1, 0, 0 ),
|
|
VK_API_VERSION_1_3,
|
|
};
|
|
std::vector<const char*> vk_exts = state->get_vulkan_exts();
|
|
VkInstanceCreateInfo instance_create_info = {
|
|
VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO,
|
|
NULL,
|
|
0,
|
|
&application_info,
|
|
0,
|
|
NULL,
|
|
static_cast<uint32_t>(vk_exts.size()),
|
|
vk_exts.data()
|
|
};
|
|
VkResult res = vkCreateInstance(&instance_create_info, NULL, &__instance);
|
|
assert(res == VK_SUCCESS);
|
|
}
|
|
void VulkanState::__make_surface(GlfwWindow* win, VkSurfaceKHR* surf) {
|
|
VkResult res = win->__make_surface(__instance, surf);
|
|
assert(res == VK_SUCCESS);
|
|
}
|
|
}
|