Improve LINE_F code

This commit is contained in:
2023-05-27 22:21:02 +02:00
parent f67361c62b
commit 3d0a5b81c2
5 changed files with 108 additions and 47 deletions

View File

@@ -45,14 +45,9 @@ namespace JabyEngine {
internal::render(reinterpret_cast<const uint32_t*>(&primitive), sizeof(T)/sizeof(uint32_t));
}
template<size_t N>
static void render(const LINE_F (&line)[N]) {
internal::render(reinterpret_cast<const uint32_t*>(&line), N);
}
template<size_t N>
static void render(const LineMaker::Type<LINE_F, N>& line_type) {
internal::render(reinterpret_cast<const uint32_t*>(&line_type), sizeof(line_type)/sizeof(uint32_t));
template<typename T, size_t N>
static enable_if<internal::is_render_primitive<T>::value>::type render(const LINE_F (&primitives)[N]) {
internal::render(reinterpret_cast<const uint32_t*>(&primitives), (sizeof(T)/sizeof(uint32_t))*N);
}
uint8_t swap_buffers_vsync(uint8_t syncs, bool clear_screen = true);