void renderer::text( int x, int y, unsigned long font, std::string text, bool centered, color c ) {
wchar_t temp[ 128 ];
if ( MultiByteToWideChar( CP_UTF8, 0, text.c_str(), -1, temp, 128 ) > 0 ) {
ctx::surface->set_text_color( c.r, c.g, c.b, c.a );
ctx::surface->draw_text_font( font );
if ( centered ) {
int text_width, text_height;
ctx::surface->get_text_size( font, temp, text_width, text_height );
ctx::surface->draw_text_pos( x - ( text_width / 2 ), y );
} else
ctx::surface->draw_text_pos( x, y );
ctx::surface->draw_render_text( temp, wcslen( temp ) );
}
}