This commit is contained in:
Ben Kyd
2019-07-16 14:33:14 +01:00
parent decfa32d28
commit 1400b59e21
6 changed files with 50 additions and 6 deletions

View File

@@ -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})

0
src/display/display.cpp Normal file
View File

0
src/display/display.hpp Normal file
View File

0
src/inferno.cpp Normal file
View File

View File

@@ -1,8 +1,41 @@
#ifndef INFERNO_INFERNO_H_
#define INFERNO_INFERNO_H_
class Inferno {
#include <string>
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

View File

@@ -1,9 +1,14 @@
#include <iostream>
#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;
}