This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
#include <cstdlib>
|
||||
#include <exception>
|
||||
#include <memory>
|
||||
#include "GLFW/glfw3.h"
|
||||
#include "shared/logger.h"
|
||||
#include "shared/window.h"
|
||||
@@ -18,16 +19,18 @@ int main() {
|
||||
GLFWwindow *window = OatmealUtils::initWindow("Oatmeal - createContext", 800, 600);
|
||||
|
||||
|
||||
std::shared_ptr<Oatmeal::ctx> ctx = nullptr;
|
||||
|
||||
OatmealUtils::getLogger("context")->info("Creating context");
|
||||
try {
|
||||
Oatmeal::ctx ctx(window);
|
||||
OatmealUtils::getLogger("context")->info("Device name: {}", ctx.getDeviceName());
|
||||
OatmealUtils::getLogger("context")->info("Device name: {}", ctx.getDeviceType());
|
||||
ctx = std::make_shared<Oatmeal::ctx>(window);
|
||||
} catch (const std::exception &e) {
|
||||
OatmealUtils::getLogger("context")->critical("{}", e.what());
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
OatmealUtils::getLogger("context")->info("Device name: {}", ctx->getDeviceName());
|
||||
OatmealUtils::getLogger("context")->info("Device Type: {}", ctx->getDeviceType());
|
||||
|
||||
OatmealUtils::getLogger("context")->info("Starting main loop");
|
||||
while (!glfwWindowShouldClose(window)) {
|
||||
|
||||
@@ -34,17 +34,17 @@ namespace Oatmeal {
|
||||
|
||||
float queuePriority = 0.5f;
|
||||
vk::DeviceQueueCreateInfo deviceQueueCreateInfo = {
|
||||
.queueFamilyIndex = m_queueIndex,
|
||||
.queueCount = 1,
|
||||
.pQueuePriorities = &queuePriority,
|
||||
.queueFamilyIndex = m_queueIndex,
|
||||
.queueCount = 1,
|
||||
.pQueuePriorities = &queuePriority,
|
||||
};
|
||||
|
||||
vk::DeviceCreateInfo deviceCreateInfo = {
|
||||
.pNext = &featureChain.get<vk::PhysicalDeviceFeatures2>(),
|
||||
.queueCreateInfoCount = 1,
|
||||
.pQueueCreateInfos = &deviceQueueCreateInfo,
|
||||
.enabledExtensionCount = static_cast<uint32_t>(requiredDeviceExtensions.size()),
|
||||
.ppEnabledExtensionNames = requiredDeviceExtensions.data(),
|
||||
.pNext = &featureChain.get<vk::PhysicalDeviceFeatures2>(),
|
||||
.queueCreateInfoCount = 1,
|
||||
.pQueueCreateInfos = &deviceQueueCreateInfo,
|
||||
.enabledExtensionCount = static_cast<uint32_t>(requiredDeviceExtensions.size()),
|
||||
.ppEnabledExtensionNames = requiredDeviceExtensions.data(),
|
||||
};
|
||||
|
||||
m_device = vk::raii::Device(m_physicalDevice, deviceCreateInfo);
|
||||
|
||||
Reference in New Issue
Block a user