diff --git a/CMakeLists.txt b/CMakeLists.txt index 55446ff..c81757c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,6 +8,8 @@ set(CMAKE_BUILD_TYPE Debug) set(executable output) set(SrcDIR ./src) set(TestDIR ./test) +set(CurrentTest main.cpp) + set(IncludeDIR ./include) if (UNIX) @@ -54,7 +56,11 @@ include_directories(${executable} file(GLOB SourceFiles ${SrcDIR}/* - ${SrcDIR}/util/* + ${SrcDIR}/core/* + ${SrcDIR}/display/* + ${SrcDIR}/primatives/* + ${SrcDIR}/util/* + ${TestDIR}/${CurrentTest} ) add_executable(${executable} ${SourceFiles}) diff --git a/src/display/display.cpp b/src/display/display.cpp new file mode 100644 index 0000000..e69de29 diff --git a/src/display/display.hpp b/src/display/display.hpp new file mode 100644 index 0000000..e69de29 diff --git a/src/inferno.cpp b/src/inferno.cpp new file mode 100644 index 0000000..e69de29 diff --git a/src/inferno.hpp b/src/inferno.hpp index e7971e6..30146a7 100644 --- a/src/inferno.hpp +++ b/src/inferno.hpp @@ -1,8 +1,41 @@ #ifndef INFERNO_INFERNO_H_ #define INFERNO_INFERNO_H_ -class Inferno { - +#include + +class Display; + +enum OperationMode { + MODE_PROGRESSIVE_GUI, + MODE_PROGRESSIVE_IMG, + MODE_SAMPLES_IMG +}; + +// General idea is that the rendering stays the same (Other than progressive / sampling) +// and the renderer passes a full framebuffer (different depending on mode) to either the +// display or an image generator, undecided how this will work but it will make for some +// interesting features, ImGui can be used for settings inside the progressive mode gui + +class InfernoEngine { +public: + + void SetMode(OperationMode mode); + + // Initializes the SDL framebuffer with OpenGL + bool InitWindow(); + + // Queries the modules, if one of them errored it finds their error string + // and returns it to the main execution code + std::string LastError(); + +private: + + OperationMode m_mode = MODE_PROGRESSIVE_GUI; + + // Gotta be a pointer so that if the display + // mode is not selected then it is nothing + Display* m_display = nullptr; + }; #endif diff --git a/test/main.cpp b/test/main.cpp index 75c839a..dca59cc 100644 --- a/test/main.cpp +++ b/test/main.cpp @@ -1,9 +1,14 @@ #include -#include "../src/inferno.hppd" +#include "../src/inferno.hpp" int main(int argc, char** argv) { + InfernoEngine inferno; + + inferno.SetMode(MODE_PROGRESSIVE_GUI); + bool status = inferno.InitWindow(); + if (!status { + std::cout << "Error initializing window: " << inferno.LastError() << std::endl; + } - Inferno inferno; - std::cout << "lol" << std::endl; }