checkpoint

This commit is contained in:
2026-04-11 23:57:57 -05:00
parent 44a5e2cab9
commit b196c97cf0
7 changed files with 15 additions and 4 deletions

View File

@@ -23,6 +23,7 @@ add_executable(ouros
src/main.cpp
src/app/App.cpp
src/app/Window.cpp
src/engine/Engine.cpp
)
target_include_directories(ouros PRIVATE

View File

@@ -43,6 +43,7 @@ Below is beyond Sascha's guide, but available elsewhere on his github. These are
- CMake (im using 4.0.0)
- C++20 compatible compiler (I use g++12 or MSVC++17) (probably works with mingw but I haven't tested it myself)
- Vulkan compatible gpu drivers (tested with an RTX3070 and an R9700)
- Vulkan SDK (https://vulkan.lunarg.com/sdk/home) <- the installer provides the option to install SDL and VOC as well as verifies GPU drivers
- SDL3 (im using version 3.4.4)
- Will add more as the project grows

View File

@@ -16,6 +16,7 @@ void App::init() {
utils::debugPrint(__FUNCTION__, __LINE__, "Init app.", utils::DebugLevel::Trace);
window_ = new Window();
engine_ = new Engine(window_);
}
@@ -34,6 +35,11 @@ int App::run() {
quit = true;
}
}
// pass vulkan handling to engine
// call engine.render() or something
// engine has a pointer to window so can handle pushing to the screen
}
// SDL teardown handled in window destructor

View File

@@ -2,6 +2,7 @@
#pragma once
#include "Window.hpp"
#include "engine/Engine.hpp"
class App {
@@ -19,5 +20,6 @@ private:
void init();
Window* window_;
Engine* engine_;
};

View File

@@ -9,15 +9,15 @@ Window::Window() {
Window::~Window() {
SDL_DestroyWindow(window_);
SDL_DestroyWindow(sdlWindow_);
SDL_Quit();
}
int Window::init() {
window_ = SDL_CreateWindow("How to Vulkan", 1280u, 720u, SDL_WINDOW_VULKAN | SDL_WINDOW_RESIZABLE);
sdlWindow_ = SDL_CreateWindow("How to Vulkan", 1280u, 720u, SDL_WINDOW_VULKAN | SDL_WINDOW_RESIZABLE);
return (window_ == nullptr);
return (sdlWindow_ == nullptr);
}

View File

@@ -17,6 +17,6 @@ private:
int init();
SDL_Window* window_;
SDL_Window* sdlWindow_;
};

View File

@@ -40,6 +40,7 @@ namespace utils {
if(!(debugMask >> debugLevel)) return; // then ignore this debug level
std::cout << "[ " << std::left << std::setw(16) << function << ": " << std::right << std::setw(4) << line << ", " << std::left << std::setw(8) << debugTypeStrings[debugLevel] << " ] " << message << std::endl;
// TODO: add timestamps
return;
}