examples - rework shared into header only

This commit is contained in:
2026-04-12 23:26:50 -04:00
parent c412073c23
commit fd35e93831
5 changed files with 100 additions and 73 deletions

View File

@@ -1,31 +1,16 @@
#include <cstdint>
#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("window", nullptr);
OatmealUtils::createLogger("context", nullptr);
OatmealUtils::get("window")->info("Initializing GLFW");
glfwInit();
OatmealUtils::get("window")->info("Setting window hints");
glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
glfwWindowHint(GLFW_RESIZABLE, GLFW_FALSE);
OatmealUtils::get("window")->info("Create window");
GLFWwindow *window = glfwCreateWindow(800, 600, "Oatmeal - Basic GLFW window", nullptr, nullptr);
if (window == nullptr) {
const char *desc;
uint32_t code = glfwGetError(&desc);
OatmealUtils::get("window")->critical("Failed to create window: ({}) {}", code, desc);
exit(EXIT_FAILURE);
}
GLFWwindow *window = OatmealUtils::initWindow("Oatmeal - createContext", 800, 600);
try {
Oatmeal::ctx ctx(window);