- if( !ui_glyph_override )
- {
- u32 compressed[] = {
- #include "vg/vg_pxfont.h"
- };
-
- u32 pixels = 0, total = 256*256, data = 0;
- u8 *image = malloc( total );
-
- while( pixels < total )
- {
- for( int b = 31; b >= 0; b-- )
- {
- image[ pixels ++ ] = (compressed[data] & (0x1 << b))? 0xff: 0x00;
-
- if( pixels >= total )
- {
- total = 0;
- break;
- }
- }
- data++;
- }
-
- glGenTextures( 1, &ui_glyph_texture );
- glBindTexture( GL_TEXTURE_2D, ui_glyph_texture );
-
- glTexImage2D( GL_TEXTURE_2D, 0, GL_R8, 256, 256, 0, GL_RED, GL_UNSIGNED_BYTE, image );
-
- vg_tex2d_clamp();
- vg_tex2d_nearest();
-
- free( image );
- }
+ u32 compressed[] = {
+ #include "vg/vg_pxfont.h"
+ };
+
+ u32 pixels = 0, total = 256*256, data = 0;
+ u8 *image = malloc( total );
+
+ while( pixels < total )
+ {
+ for( int b = 31; b >= 0; b-- )
+ {
+ image[ pixels ++ ] = (compressed[data] & (0x1 << b))? 0xff: 0x00;
+
+ if( pixels >= total )
+ {
+ total = 0;
+ break;
+ }
+ }
+ data++;
+ }
+
+ glGenTextures( 1, &ui_glyph_texture );
+ glBindTexture( GL_TEXTURE_2D, ui_glyph_texture );
+
+ glTexImage2D( GL_TEXTURE_2D, 0, GL_R8, 256, 256, 0, GL_RED, GL_UNSIGNED_BYTE, image );
+
+ vg_tex2d_clamp();
+ vg_tex2d_nearest();
+
+ free( image );