#include "shaders/model_menu.h"
#include "vg_steam_friends.h"
-#include "submodules/tinydir/tinydir.h"
VG_STATIC mdl_context menu_model;
VG_STATIC mdl_array_ptr menu_markers;
VG_STATIC const char *playermodels[] = { "ch_new", "ch_jordan", "ch_outlaw" };
-vg_tex2d tex_menu = { .path = "textures/menu.qoi",.flags = VG_TEXTURE_NEAREST };
+GLuint tex_menu;
VG_STATIC struct input_binding input_menu_h,
input_menu_v,
struct menu_map_file *mf = &game_menu.maps_list[ game_menu.map_count ];
vg_strncpy( file.name, mf->name,
- vg_list_size(game_menu.maps_list[0].name)-1 );
+ vg_list_size(game_menu.maps_list[0].name),
+ k_strncpy_always_add_null );
game_menu.map_count ++;
if( game_menu.map_count == vg_list_size(game_menu.maps_list) )
mdl_open( &menu_model, "models/rs_menu.mdl", vg_mem.rtmemory );
mdl_load_metadata_block( &menu_model, vg_mem.rtmemory );
- mdl_load_mesh_block( &menu_model, vg_mem.scratch );
mdl_load_array( &menu_model, &menu_markers, "ent_marker", vg_mem.rtmemory );
//mdl_invert_uv_coordinates( &menu_model );
+ mdl_async_load_glmesh( &menu_model, &menu_glmesh );
mdl_close( &menu_model );
- vg_acquire_thread_sync();
- {
- mdl_unpack_glmesh( &menu_model, &menu_glmesh );
- vg_tex2d_init( (vg_tex2d *[]){ &tex_menu }, 1 );
- }
- vg_release_thread_sync();
+ vg_tex2d_load_qoi_async_file( "textures/menu.qoi",
+ VG_TEX2D_CLAMP|VG_TEX2D_NEAREST,
+ &tex_menu );
+
for( int i=0; i<vg_list_size(menu_buttons); i++ ){
struct menu_button *btn = &menu_buttons[i];
if( !btn->mesh ){
vg_info( "info: %s\n", btn->name );
- vg_fatal_exit_loop( "Menu programming error" );
+ vg_fatal_error( "Menu programming error" );
}
}
vg_input_update( 1, &input_menu_press );
vg_input_update( 1, &input_menu_toggle );
vg_input_update( 1, &input_menu_toggle_kbm );
+ return;
int toggle_gp = vg_input_button_down( &input_menu_toggle ),
toggle_kb = vg_input_button_down( &input_menu_toggle_kbm ),
shader_model_menu_use();
shader_model_menu_uColour( (v4f){ 1.0f,1.0f,1.0f,1.0f} );
shader_model_menu_uTexMain( 1 );
- vg_tex2d_bind( &tex_menu, 1 );
+
+ glActiveTexture( GL_TEXTURE1 );
+ glBindTexture( GL_TEXTURE_2D, tex_menu );
shader_model_menu_uPv( cam->mtx.pv );
shader_model_menu_uPvmPrev( cam->mtx_prev.pv );