random
[vg.git] / vg_ui.h
diff --git a/vg_ui.h b/vg_ui.h
index 0c4b4159bc5636419e86f430fe185aac93410adb..c86e4c809c5b407d6002718524266ed9c6809990 100644 (file)
--- a/vg_ui.h
+++ b/vg_ui.h
@@ -3,6 +3,7 @@
 #ifndef VG_UI_H
 #define VG_UI_H
 
+#define VG_GAME
 #include "vg/vg.h"
 #include "vg/vg_tex.h"
 #include "vg/vg_shader.h"
@@ -158,7 +159,7 @@ struct
 } 
 static vg_uictx;
 
-#define UI_GLYPH_SPACING_X 9
+#define UI_GLYPH_SPACING_X 8
 
 static GLuint ui_glyph_texture = 0;
 static ui_colourset ui_default_colours = {
@@ -167,7 +168,7 @@ static ui_colourset ui_default_colours = {
        .active = 0xffad9f9e
 };
 
-VG_STATIC void ui_init_context(void)
+VG_STATIC void _vg_ui_init(void)
 {
    if( !vg_shader_compile( &_shader_ui ) ) 
       vg_fatal_exit_loop( "Failed to compile ui shader" );
@@ -179,6 +180,7 @@ VG_STATIC void ui_init_context(void)
 
    vg_uictx.max_indices = 20000;
    vg_uictx.max_verts = 30000;
+   vg_uictx.colours = &ui_default_colours;
        
        /* Generate the buffer we are gonna be drawing to */
    glGenVertexArrays( 1, &vg_uictx.vao );
@@ -226,7 +228,7 @@ VG_STATIC void ui_init_context(void)
 
        /* Alloc RAM default context */
    u32 vert_size = vg_uictx.max_verts*sizeof(struct ui_vert),
-       inds_size = vg_uictx.max_indices*sizeof(u16);
+       inds_size = vg_align8( vg_uictx.max_indices*sizeof(u16) );
    
    vg_uictx.vertex_buffer = vg_linear_alloc( vg_mem.rtmemory, vert_size );
    vg_uictx.indice_buffer = vg_linear_alloc( vg_mem.rtmemory, inds_size );
@@ -237,7 +239,7 @@ VG_STATIC void ui_init_context(void)
    
        /* Load default font */
    u32 compressed[] = {
-      #include "vg/vg_pxfont.h"
+      #include "vg/vg_pxfont_thin.h"
    };
 
    u32 pixels = 0, total = 256*256, data = 0;