158 lines
6.0 KiB
C++
158 lines
6.0 KiB
C++
#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);
|
|
}
|
|
|
|
// ###################################################################
|
|
|
|
static constexpr GPU::AreaI16 AreaI16(int16_t x, int16_t y, int16_t w, int16_t h) {
|
|
return creator_template<GPU::AreaI16>(x, y, w, h);
|
|
}
|
|
|
|
static constexpr GPU::AreaI16 AreaI16(GPU::PositionI16 pos, GPU::SizeI16 size) {
|
|
return creator_template<GPU::AreaI16>(pos, size);
|
|
}
|
|
|
|
// ###################################################################
|
|
|
|
static constexpr GPU::AreaU16 AreaU16(uint16_t x, uint16_t y, uint16_t w, uint16_t h) {
|
|
return creator_template<GPU::AreaU16>(x, y, w, h);
|
|
}
|
|
|
|
static constexpr GPU::AreaU16 AreaU16(GPU::PositionU16 pos, GPU::SizeU16 size) {
|
|
return creator_template<GPU::AreaU16>(pos, size);
|
|
}
|
|
|
|
// ###################################################################
|
|
|
|
static constexpr GPU::PagePosition PagePosition() {
|
|
return creator_template<GPU::PagePosition>(0_u8, 0_u8);
|
|
}
|
|
|
|
static constexpr GPU::PagePosition PagePosition(uint8_t u, uint8_t v) {
|
|
return creator_template<GPU::PagePosition>(u, v);
|
|
}
|
|
|
|
// ###################################################################
|
|
|
|
static constexpr GPU::PageClut PageClut() {
|
|
return creator_template<GPU::PageClut>(0_u16, 0_u16);
|
|
}
|
|
|
|
static constexpr GPU::PageClut PageClut(uint16_t x, uint16_t y) {
|
|
return creator_template<GPU::PageClut>(x, y);
|
|
}
|
|
|
|
// ###################################################################
|
|
|
|
static constexpr GPU::TPage TPage() {
|
|
return creator_template<GPU::TPage>(0_u16, 0_u16, GPU::SemiTransparency::B_add_F, GPU::TexturePageColor::$4bit);
|
|
}
|
|
|
|
static constexpr GPU::TPage TPage(uint16_t x, uint16_t y, GPU::SemiTransparency transparency, GPU::TexturePageColor clut_color) {
|
|
return creator_template<GPU::TPage>(x, y, transparency, clut_color);
|
|
}
|
|
|
|
// ###################################################################
|
|
|
|
static constexpr GPU::PagePositionClut PagePositionClut() {
|
|
return creator_template<GPU::PagePositionClut>(PagePosition(), PageClut());
|
|
}
|
|
|
|
static constexpr GPU::PagePositionClut PagePositionClut(GPU::PagePosition page, GPU::PageClut clut) {
|
|
return creator_template<GPU::PagePositionClut>(page, clut);
|
|
}
|
|
|
|
// ###################################################################
|
|
|
|
static constexpr GPU::VertexColor VertexColor() {
|
|
return creator_template<GPU::VertexColor>(Vertex(), GPU::Color24::Black());
|
|
}
|
|
|
|
static constexpr GPU::VertexColor VertexColor(GPU::Vertex pos, GPU::Color24 color) {
|
|
return creator_template<GPU::VertexColor>(pos, color);
|
|
}
|
|
|
|
// ###################################################################
|
|
|
|
static constexpr GPU::ColorVertex ColorVertex() {
|
|
return creator_template<GPU::ColorVertex>(GPU::Color24::Black(), Vertex());
|
|
}
|
|
|
|
static constexpr GPU::ColorVertex ColorVertex(GPU::Color24 color, GPU::Vertex pos) {
|
|
return creator_template<GPU::ColorVertex>(color, pos);
|
|
}
|
|
|
|
// ###################################################################
|
|
// ###################################################################
|
|
// ###################################################################
|
|
// ###################################################################
|
|
// ###################################################################
|
|
// ###################################################################
|
|
}
|
|
}
|
|
|
|
#endif // !__JABYENGINE_GPU_PRIMITIVES_HPP__
|