Files
oatmeal/examples/createContext/main.cpp
firewire b90c980bee
Some checks failed
Build / Build (push) Has been cancelled
ctx - device
2026-04-14 18:49:35 -04:00

43 lines
1.1 KiB
C++

// createContext
// Still in progress, although I'm 95% sure this wont get changed.
// Come back later!
// - Firewire
#include <cstdlib>
#include <exception>
#include "GLFW/glfw3.h"
#include "shared/logger.h"
#include "shared/window.h"
#include "ctx.h"
int main() {
OatmealUtils::initLogging();
OatmealUtils::createLogger("context", nullptr);
GLFWwindow *window = OatmealUtils::initWindow("Oatmeal - createContext", 800, 600);
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());
} catch (const std::exception &e) {
OatmealUtils::getLogger("context")->critical("{}", e.what());
return EXIT_FAILURE;
}
OatmealUtils::getLogger("context")->info("Starting main loop");
while (!glfwWindowShouldClose(window)) {
glfwPollEvents();
}
OatmealUtils::getLogger("window")->info("Cleaning up");
glfwDestroyWindow(window);
glfwTerminate();
return 0;
}