diff options
author | Julian T <julian@jtle.dk> | 2021-01-12 18:48:40 +0100 |
---|---|---|
committer | Julian T <julian@jtle.dk> | 2021-01-12 18:48:40 +0100 |
commit | 8251be3e7ec0e381391c951fd4c8f1ab8080bef9 (patch) | |
tree | 8caaf285d59fadb3fb4ce6f3a4c9e1d956d8e21e | |
parent | 0f9e88ccf0510ab4d830529fa539ef6db715f988 (diff) |
Reorgranize source file structure
-rw-r--r-- | CMakeLists.txt | 11 | ||||
-rw-r--r-- | app/main.cpp | 8 | ||||
-rw-r--r-- | src/core/common.hpp (renamed from src/common.hpp) | 0 | ||||
-rw-r--r-- | src/core/ray.cpp (renamed from src/ray.cpp) | 0 | ||||
-rw-r--r-- | src/core/ray.hpp (renamed from src/ray.hpp) | 0 | ||||
-rw-r--r-- | src/core/vector.cpp (renamed from src/vector.cpp) | 0 | ||||
-rw-r--r-- | src/core/vector.hpp (renamed from src/vector.hpp) | 0 | ||||
-rw-r--r-- | src/object.cpp | 2 | ||||
-rw-r--r-- | src/object.hpp | 4 | ||||
-rw-r--r-- | src/render.cpp | 4 | ||||
-rw-r--r-- | src/render.hpp | 4 |
11 files changed, 20 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index df9bd70..7ae5197 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.10) +cmake_minimum_required(VERSION 3.13) project(pathtracing) @@ -15,7 +15,14 @@ set(CMAKE_CXX_FLAGS_DEBUG "-g") set(CMAKE_CXX_FLAGS_RELEASE "-O3") FILE(GLOB app_sources ${CMAKE_SOURCE_DIR}/app/*.cpp) -FILE(GLOB sources ${CMAKE_SOURCE_DIR}/src/*.cpp) +SET(sources + src/core/ray.cpp + src/core/vector.cpp + src/object.cpp + src/render.cpp + src/scene.cpp + ) +list(TRANSFORM sources PREPEND ${CMAKE_SOURCE_DIR}/) FILE(GLOB test_sources ${CMAKE_SOURCE_DIR}/test/*.cpp) add_executable(pathtracing ${sources} ${app_sources}) diff --git a/app/main.cpp b/app/main.cpp index 16de1f6..ebb0536 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -3,7 +3,7 @@ #include <qpushbutton.h> #include "mainwindow.hpp" -#include "vector.hpp" +#include <core/vector.hpp> #include <scene.hpp> #include <render.hpp> #include <object.hpp> @@ -15,10 +15,10 @@ int main(int argc, char *argv[]) QApplication a(argc, argv); Scene scn; Config conf; - conf.m_width = 500; - conf.m_height = 500; + conf.m_width = 1000; + conf.m_height = 1000; conf.m_maxhops = 5; - conf.m_samples = 100; + conf.m_samples = 10000; conf.m_framerate = 3; conf.m_workers = 4; diff --git a/src/common.hpp b/src/core/common.hpp index fd219bf..fd219bf 100644 --- a/src/common.hpp +++ b/src/core/common.hpp diff --git a/src/ray.cpp b/src/core/ray.cpp index 7bc6201..7bc6201 100644 --- a/src/ray.cpp +++ b/src/core/ray.cpp diff --git a/src/ray.hpp b/src/core/ray.hpp index 6341d44..6341d44 100644 --- a/src/ray.hpp +++ b/src/core/ray.hpp diff --git a/src/vector.cpp b/src/core/vector.cpp index 51d8e2e..51d8e2e 100644 --- a/src/vector.cpp +++ b/src/core/vector.cpp diff --git a/src/vector.hpp b/src/core/vector.hpp index 20e8210..20e8210 100644 --- a/src/vector.hpp +++ b/src/core/vector.hpp diff --git a/src/object.cpp b/src/object.cpp index 15fc267..0f7332f 100644 --- a/src/object.cpp +++ b/src/object.cpp @@ -2,7 +2,7 @@ #include <math.h> #include <iostream> -#include "common.hpp" +#include "core/common.hpp" void Color::clamp() { if (m_x > 1) { m_x = 1; } diff --git a/src/object.hpp b/src/object.hpp index 3b108fb..1cfb254 100644 --- a/src/object.hpp +++ b/src/object.hpp @@ -2,8 +2,8 @@ #define OBJECT_H #include <memory> -#include "vector.hpp" -#include "ray.hpp" +#include "core/vector.hpp" +#include "core/ray.hpp" class Color : public Vec3d { public: diff --git a/src/render.cpp b/src/render.cpp index 3f2280d..a81c6bb 100644 --- a/src/render.cpp +++ b/src/render.cpp @@ -1,6 +1,6 @@ #include "render.hpp" -#include "vector.hpp" -#include "common.hpp" +#include "core/vector.hpp" +#include "core/common.hpp" #include <cstdlib> #include <math.h> diff --git a/src/render.hpp b/src/render.hpp index 7557fce..8102686 100644 --- a/src/render.hpp +++ b/src/render.hpp @@ -1,8 +1,8 @@ #ifndef RENDER_H #define RENDER_H -#include "vector.hpp" -#include "ray.hpp" +#include "core/vector.hpp" +#include "core/ray.hpp" #include "scene.hpp" class Random { |