#include "include/global_primitive_buffer.hpp"
#include <FontWriter/font_writer.hpp>

namespace JabyEngine {
    PrimitiveFactory GlobalPrimitiveFactory = PrimitiveFactory::empty();

    void GlobalFontPrimitivePool :: setup(FontPrimitive* start, size_t length) {
        const auto*const buffer_end = start + length;

        for(auto* cur_prim = start; cur_prim < buffer_end; cur_prim++) {
            *cur_prim = FontPrimitive::create(Make::SPRT(Make::AreaI16(), Make::OffsetPageWithClut()));
        }
        
        GlobalPrimitiveFactory = PrimitiveFactory::create(start, length);
    }
}