2022-10-31 00:51:51 -04:00
|
|
|
/*
|
|
|
|
* Created by Brett Terpstra 6920201 on 30/10/22.
|
|
|
|
* Copyright (c) 2022 Brett Terpstra. All Rights Reserved.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef STEP_3_DEBUG_GUI_H
|
|
|
|
#define STEP_3_DEBUG_GUI_H
|
|
|
|
|
|
|
|
#include <functional>
|
2022-11-19 12:54:45 -05:00
|
|
|
#include <memory>
|
2022-10-31 00:51:51 -04:00
|
|
|
#include <string>
|
2022-11-19 12:54:45 -05:00
|
|
|
#include <engine/math/bvh.h>
|
2022-10-31 00:51:51 -04:00
|
|
|
|
2022-12-13 17:36:01 -05:00
|
|
|
/**
|
|
|
|
* This stuff can safely be ignored as it is purely for me to debug
|
|
|
|
*/
|
2022-10-31 00:51:51 -04:00
|
|
|
namespace Raytracing {
|
|
|
|
class DebugUI {
|
|
|
|
public:
|
|
|
|
static void render(const std::function<void()>& generalTab);
|
2022-12-13 17:36:01 -05:00
|
|
|
|
2022-10-31 00:51:51 -04:00
|
|
|
static void registerTab(const std::string& name, const std::function<void()>& tabFunc);
|
|
|
|
};
|
2022-11-19 12:54:45 -05:00
|
|
|
|
|
|
|
class DebugObject {
|
|
|
|
public:
|
|
|
|
virtual void render() = 0;
|
|
|
|
};
|
2022-12-13 17:36:01 -05:00
|
|
|
|
2022-11-19 12:54:45 -05:00
|
|
|
class DebugMenus {
|
|
|
|
public:
|
|
|
|
static void add(const std::shared_ptr<DebugObject>& object);
|
2022-12-13 17:36:01 -05:00
|
|
|
|
2022-11-21 13:39:01 -05:00
|
|
|
static void remove(DebugObject* object);
|
2022-12-13 17:36:01 -05:00
|
|
|
|
2022-11-19 12:54:45 -05:00
|
|
|
static void render();
|
|
|
|
};
|
2022-12-13 17:36:01 -05:00
|
|
|
|
2022-11-19 12:54:45 -05:00
|
|
|
class DebugBVH : public DebugObject {
|
|
|
|
private:
|
2022-12-13 17:36:01 -05:00
|
|
|
BVHTree* m_bvhTree = nullptr;
|
|
|
|
TriangleBVHTree* m_triangleBVHTree = nullptr;
|
2022-11-19 12:54:45 -05:00
|
|
|
Shader& m_shader;
|
|
|
|
public:
|
|
|
|
explicit DebugBVH(BVHTree* bvhTree, Shader& shader);
|
2022-12-13 17:36:01 -05:00
|
|
|
|
2022-11-19 12:54:45 -05:00
|
|
|
explicit DebugBVH(TriangleBVHTree* bvhTree, Shader& shader);
|
2022-12-13 17:36:01 -05:00
|
|
|
|
2022-11-19 12:54:45 -05:00
|
|
|
void render();
|
2022-12-13 17:36:01 -05:00
|
|
|
|
2022-11-19 12:54:45 -05:00
|
|
|
~DebugBVH();
|
|
|
|
};
|
2022-10-31 00:51:51 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif //STEP_3_DEBUG_GUI_H
|