mockup of utility functions
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "./pipeline/renderer_3d_pipeline.hpp"
|
||||
#include "./renderer_3d_utility.hpp"
|
||||
|
||||
namespace Tyra {
|
||||
|
||||
@@ -19,6 +20,8 @@ class Renderer3D {
|
||||
Renderer3D();
|
||||
~Renderer3D();
|
||||
|
||||
Renderer3DUtility utility;
|
||||
|
||||
/** Deinitialize previous pipeline and initialize new pipeline */
|
||||
void usePipeline(Renderer3DPipeline* pipeline);
|
||||
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
# _____ ____ ___
|
||||
# | \/ ____| |___|
|
||||
# | | | \ | |
|
||||
#-----------------------------------------------------------------------
|
||||
# Copyright 2022, tyra - https://github.com/h4570/tyra
|
||||
# Licensed under Apache License 2.0
|
||||
# Sandro Sobczyński <sandro.sobczynski@gmail.com>
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "math/vec4.hpp"
|
||||
#include "renderer/models/color.hpp"
|
||||
#include "renderer/core/3d/bbox/core_bbox.hpp"
|
||||
|
||||
namespace Tyra {
|
||||
|
||||
/** Debug functions, with bad performance. */
|
||||
class Renderer3DUtility {
|
||||
public:
|
||||
Renderer3DUtility();
|
||||
~Renderer3DUtility();
|
||||
|
||||
void drawPoint(const Vec4& v);
|
||||
void drawPoint(const Vec4& v, const float& size);
|
||||
void drawPoint(const Vec4& v, const float& size, const Color& color);
|
||||
|
||||
void drawLine(const Vec4& from, const Vec4& to);
|
||||
void drawLine(const Vec4& from, const Vec4& to, const float& size);
|
||||
void drawLine(const Vec4& from, const Vec4& to, const float& size,
|
||||
const Color& color);
|
||||
|
||||
void drawBBox(const CoreBBox& v);
|
||||
void drawBBox(const CoreBBox& v, const float& size);
|
||||
void drawBBox(const CoreBBox& v, const float& size, const Color& color);
|
||||
};
|
||||
|
||||
} // namespace Tyra
|
||||
@@ -0,0 +1,54 @@
|
||||
|
||||
/*
|
||||
# _____ ____ ___
|
||||
# | \/ ____| |___|
|
||||
# | | | \ | |
|
||||
#-----------------------------------------------------------------------
|
||||
# Copyright 2022, tyra - https://github.com/h4570/tyra
|
||||
# Licensed under Apache License 2.0
|
||||
# Sandro Sobczyński <sandro.sobczynski@gmail.com>
|
||||
*/
|
||||
|
||||
#include "renderer/3d/renderer_3d_utility.hpp"
|
||||
|
||||
namespace Tyra {
|
||||
|
||||
Renderer3DUtility::Renderer3DUtility() {}
|
||||
|
||||
Renderer3DUtility::~Renderer3DUtility() {}
|
||||
|
||||
void Renderer3DUtility::drawPoint(const Vec4& v) { drawPoint(v, 1.0F); }
|
||||
void Renderer3DUtility::drawLine(const Vec4& from, const Vec4& to) {
|
||||
drawLine(from, to, 1.0F);
|
||||
}
|
||||
void Renderer3DUtility::drawBBox(const CoreBBox& v) { drawBBox(v, 1.0F); }
|
||||
|
||||
void Renderer3DUtility::drawPoint(const Vec4& v, const float& size) {
|
||||
drawPoint(v, size, Color(128.0F, 0.0F, 0.0F, 128.0F));
|
||||
}
|
||||
|
||||
void Renderer3DUtility::drawLine(const Vec4& from, const Vec4& to,
|
||||
const float& size) {
|
||||
drawLine(from, to, size, Color(128.0F, 0.0F, 0.0F, 128.0F));
|
||||
}
|
||||
|
||||
void Renderer3DUtility::drawBBox(const CoreBBox& v, const float& size) {
|
||||
drawBBox(v, size, Color(128.0F, 0.0F, 0.0F, 128.0F));
|
||||
}
|
||||
|
||||
void Renderer3DUtility::drawPoint(const Vec4& v, const float& size,
|
||||
const Color& color) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
void Renderer3DUtility::drawLine(const Vec4& from, const Vec4& to,
|
||||
const float& size, const Color& color) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
void Renderer3DUtility::drawBBox(const CoreBBox& v, const float& size,
|
||||
const Color& color) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
} // namespace Tyra
|
||||
Reference in New Issue
Block a user