#include "MyTextTestScene.h" #include #include #include #include std::map> gen_font_stuff(const image_loader::ImageRGBA& image) { std::map> ret; ret.emplace('a', charcoal::Rectangle(0, image.height / 2, 0, image.width / 2)); ret.emplace('b', charcoal::Rectangle(image.height / 2, image.height, image.width / 2, image.width)); return ret; } MyTextTestScene::MyTextTestScene(Application& application) : Scene(application), m_font_image(image_loader::load_file(IMAGE_PATH "uber.png")), m_font(m_font_image, gen_font_stuff(m_font_image)), m_text_image(m_font.get_text_image("ba")), m_text( meshgenerator::gen_rect_pt(DRAW_TRIANGLES, (float)m_text_image.width, (float)m_text_image.height), DRAW_TRIANGLES, TextureFactory::gen_image_texture(m_text_image), texturegenerator::gen_quick_sampler() ), m_camera(m_screen_size), m_text_batch(&m_text, 1) { m_pipeline.set_camera(&m_camera); m_pipeline.add_batch(&m_text_batch); } void MyTextTestScene::init() { m_text_batch.init(); m_text_batch.reset_rendered(); m_text_batch.add_rendered(m_text_pose); } void MyTextTestScene::update(float delta_time, clock_t clock) { // Do Nothing } void MyTextTestScene::prerender() { m_camera.prerender(); m_text_batch.prerender(); } void MyTextTestScene::render() { glutil::clear_screen(); m_pipeline.render(); }