checkpoint
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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_;
|
||||
|
||||
};
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
@@ -17,6 +17,6 @@ private:
|
||||
|
||||
int init();
|
||||
|
||||
SDL_Window* window_;
|
||||
SDL_Window* sdlWindow_;
|
||||
|
||||
};
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user