Create maker functions for Position and Size
This commit is contained in:
@@ -1,7 +1,71 @@
|
||||
#ifndef __JABYENGINE_GPU_PRIMITIVES_HPP__
|
||||
#define __JABYENGINE_GPU_PRIMITIVES_HPP__
|
||||
#include "../Auxiliary/literals.hpp"
|
||||
#include "Primitives/primitive_gpu_commands.hpp"
|
||||
#include "Primitives/primitive_line_types.hpp"
|
||||
#include "Primitives/primitive_rectangle_types.hpp"
|
||||
#include "Primitives/primitive_poly_types.hpp"
|
||||
|
||||
namespace JabyEngine {
|
||||
namespace Make {
|
||||
using JabyEngine::operator""_i16;
|
||||
using JabyEngine::operator""_u16;
|
||||
|
||||
template<typename T, typename...ARGS>
|
||||
static constexpr T creator_template(ARGS...args) {
|
||||
return T::create(args...);
|
||||
}
|
||||
|
||||
// ###################################################################
|
||||
|
||||
static constexpr GPU::SizeI16 SizeI16() {
|
||||
return creator_template<GPU::SizeI16>(0_i16, 0_i16);
|
||||
}
|
||||
|
||||
static constexpr GPU::SizeI16 SizeI16(int16_t x, int16_t y) {
|
||||
return creator_template<GPU::SizeI16>(x, y);
|
||||
}
|
||||
|
||||
// ###################################################################
|
||||
|
||||
static constexpr GPU::SizeU16 SizeU16() {
|
||||
return creator_template<GPU::SizeU16>(0_u16, 0_u16);
|
||||
}
|
||||
|
||||
static constexpr GPU::SizeU16 SizeU16(uint16_t x, uint16_t y) {
|
||||
return creator_template<GPU::SizeU16>(x, y);
|
||||
}
|
||||
|
||||
// ###################################################################
|
||||
|
||||
static constexpr GPU::PositionI16 PositionI16() {
|
||||
return creator_template<GPU::PositionI16>(0_i16, 0_i16);
|
||||
}
|
||||
|
||||
static constexpr GPU::PositionI16 PositionI16(int16_t x, int16_t y) {
|
||||
return creator_template<GPU::PositionI16>(x, y);
|
||||
}
|
||||
|
||||
// ###################################################################
|
||||
|
||||
static constexpr GPU::PositionU16 PositionU16() {
|
||||
return creator_template<GPU::PositionU16>(0_u16, 0_u16);
|
||||
}
|
||||
|
||||
static constexpr GPU::PositionU16 PositionU16(uint16_t x, uint16_t y) {
|
||||
return creator_template<GPU::PositionU16>(x, y);
|
||||
}
|
||||
|
||||
// ###################################################################
|
||||
|
||||
static constexpr GPU::Vertex Vertex() {
|
||||
return creator_template<GPU::Vertex>(0_i16, 0_i16);
|
||||
}
|
||||
|
||||
static constexpr GPU::Vertex Vertex(int16_t x, int16_t y) {
|
||||
return creator_template<GPU::Vertex>(x, y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !__JABYENGINE_GPU_PRIMITIVES_HPP__
|
Reference in New Issue
Block a user