From 700fcd53f431cb29edf4c987c701825e3f9fd0f5 Mon Sep 17 00:00:00 2001 From: firewire Date: Sun, 12 Apr 2026 17:16:41 -0400 Subject: [PATCH] imcludes --- oatmeal/src/ctx.cpp | 7 +++---- oatmeal/src/ctx.h | 51 ++++++++++++++++++++++++++++++++++++++------- 2 files changed, 46 insertions(+), 12 deletions(-) diff --git a/oatmeal/src/ctx.cpp b/oatmeal/src/ctx.cpp index 248cf4f..22e1d73 100644 --- a/oatmeal/src/ctx.cpp +++ b/oatmeal/src/ctx.cpp @@ -1,11 +1,10 @@ #include "ctx.h" -#include +#include namespace Oatmeal { -ctx::ctx() {} + ctx::ctx(GLFWwindow *window, uint32_t width, uint32_t height) {} -ctx::~ctx() {} + ctx::~ctx() {} -void ctx::test() { std::cout << "Test" << std::endl; } } // namespace Oatmeal diff --git a/oatmeal/src/ctx.h b/oatmeal/src/ctx.h index ed2abd5..f3fcf18 100644 --- a/oatmeal/src/ctx.h +++ b/oatmeal/src/ctx.h @@ -1,12 +1,47 @@ +#include "vulkan/vulkan.hpp" +#if defined(__INTELLISENSE__) || !defined(USE_CPP20_MODULES) +#include +#else +import vulkan_hpp; +#endif + +#define GLFW_INCLUDE_VULKAN +#if defined(PLATFORM_WINDOWS) +#define VK_USE_PLATFORM_WIN32_KHR +#define GLFW_EXPOSE_NATIVE_WIN32 +#elif defined(PLATFORM_LINUX) +#define VK_USE_PLATFORM_XLIB_KHR +#define GLFW_EXPOSE_NATIVE_X11 +#elif defined(PLATFORM_MACOS) +#define VK_USE_PLATFORM_MACOS_MVK +#define GLFW_EXPOSE_NATIVE_COCOA +#endif + +#define GLM_FORCE_DEFAULT_ALIGNED_GENTYPES +#define GLM_FORCE_DEPTH_ZERO_TO_ONE +#define GLM_ENABLE_EXPERIMENTAL + +#include +#include +#include + +constexpr int MAX_FRAMES_IN_FLIGHT = 2; +const std::vector validationLayers = {"VK_LAYER_KHRONOS_validation"}; +const std::vector requiredDeviceExtensions = {vk::KHRSwapchainExtensionName}; + +#ifndef NDEBUG +constexpr bool enableValidationLayers = false; +#else +constexpr bool enableValidationLayers = true; +#endif + namespace Oatmeal { -class ctx { -public: - ctx(); - ~ctx(); + class ctx { + public: + ctx(GLFWwindow *window, uint32_t width, uint32_t height); + ~ctx(); - void test(); - -private: -}; + private: + }; } // namespace Oatmeal