/*
glfont.hpp
sdragonx 2019-08-15 00:03:33
opengl字体类,提供初学者参考学习
opengl初始化之后,创建字体
font.init(L"微软雅黑", 32, 512);
然后在绘制函数里面添加以下测试代码:
//开启2D模式,后面的800x600要根据窗口的实际客户区大小设置,不然缩放之后效果不好
push_view2D(0, 0, 800, 600);
wchar_t* str = L"abcdef字体绘制abcdef?123456ijk微软雅黑";
font.color = vec4ub(255, 255, 255, 128);
font.print(0, 0, str, wcslen(str));
font.tab_print(0, 32, L"abc\t123456\t7890", TEXT_MAX);
wchar_t* tabled = L"abcdef字体绘制\tabc制表符\t123456";
font.color = vec4ub(255, 0, 0, 255);
font.tab_print(0, 64, tabled, wcslen(tabled));
font.color = vec4ub(255, 0, 0, 255);
font.draw_text(0, 200, 200, 400, str, wcslen(str), PT_LEFT);
font.color = vec4ub(0, 255, 0, 255);
font.draw_text(300, 200, 200, 400, str, wcslen(str), PT_CENTER);
font.color = vec4ub(255, 0, 255, 255);
font.draw_text(600, 200, 200, 400, str, wcslen(str), PT_RIGHT);
pop_view();
//代码结束
*/
#ifndef GLFONT_HPP_20190815000333
#define GLFONT_HPP_20190815000333
#include
#include
#include