#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"
}
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 = {
.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" );
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 );
/* 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 );
/* Load default font */
u32 compressed[] = {
- #include "vg/vg_pxfont.h"
+ #include "vg/vg_pxfont_thin.h"
};
u32 pixels = 0, total = 256*256, data = 0;