Skip to content

Commit

Permalink
atg-agg demo draw text in same pos in retina
Browse files Browse the repository at this point in the history
  • Loading branch information
yairchu committed Dec 20, 2016
1 parent b115c30 commit db558bd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion demos/atb-agg.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,13 @@ build_buffer( void )
if (!font)
return;

int pixHeight;
{
int viewport[4];
glGetIntegerv( GL_VIEWPORT, viewport );
pixHeight = viewport[3];
}

markup.font = font;
font->hinting = p_hinting;
font->kerning = p_kerning;
Expand All @@ -167,7 +174,7 @@ build_buffer( void )
font->lcd_weights[3] = (unsigned char)(p_secondary*norm*256);
font->lcd_weights[4] = (unsigned char)(p_tertiary*norm*256);
pen.x = 10;
pen.y = 600 - font->height - 10;
pen.y = pixHeight - font->height - 10;
text_buffer_printf( text_buffer, &pen, &markup, text, NULL );

// Post-processing for width and orientation
Expand Down

0 comments on commit db558bd

Please sign in to comment.