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