* =============================================================================
*
* Copyright . . . -----, ,----- ,---. .---.
- * 2021-2022 |\ /| | / | | | | /|
+ * 2021-2023 |\ /| | / | | | | /|
* | \ / | +-- / +----- +---' | / |
* | \ / | | / | | \ | / |
* | \/ | | / | | \ | / |
#include "menu.h"
static int cl_ui = 1,
- cl_view_id = 0;
+ cl_view_id = 0,
+ cl_light_edit = 0;
int main( int argc, char *argv[] )
{
{
g_conf_init();
- vg_convar_push( (struct vg_convar){
+ vg_var_push( (struct vg_var){
.name = "cl_ui",
.data = &cl_ui,
- .data_type = k_convar_dtype_i32,
+ .data_type = k_var_dtype_i32,
.opt_i32 = { .min=0, .max=1, .clamp=1 },
.persistent = 0
});
- vg_convar_push( (struct vg_convar){
+ vg_var_push( (struct vg_var){
.name = "cl_view_id",
.data = &cl_view_id,
- .data_type = k_convar_dtype_i32,
+ .data_type = k_var_dtype_i32,
+ .opt_i32 = { .min=0, .max=1, .clamp=1 },
+ .persistent = 0
+ });
+
+ vg_var_push( (struct vg_var){
+ .name = "ledit",
+ .data = &cl_light_edit,
+ .data_type = k_var_dtype_i32,
.opt_i32 = { .min=0, .max=1, .clamp=1 },
.persistent = 0
});
glBlendFunc(GL_ONE_MINUS_DST_ALPHA, GL_DST_ALPHA);
glBlendEquation(GL_FUNC_ADD);
- shader_blitblur_use();
- shader_blitblur_uTexMain( 0 );
- shader_blitblur_uTexMotion( 1 );
- shader_blitblur_uBlurStrength( cl_blur_strength / (vg.frame_delta*60.0f) );
-
- v2f menu_blurring;
- v2_muls( (v2f){ 0.04f, 0.001f }, menu_opacity, menu_blurring );
- shader_blitblur_uOverrideDir( menu_blurring );
-
- if( cl_view_id == 0 )
- render_fb_bind_texture( gpipeline.fb_main, 0, 0 );
- else if( cl_view_id == 1 )
- render_fb_bind_texture( gpipeline.fb_main, 1, 0 );
+ if( cl_blur )
+ {
+ shader_blitblur_use();
+ shader_blitblur_uTexMain( 0 );
+ shader_blitblur_uTexMotion( 1 );
+ shader_blitblur_uBlurStrength(cl_blur_strength / (vg.frame_delta*60.0f));
+
+ v2f menu_blurring;
+ v2_muls( (v2f){ 0.04f, 0.001f }, menu_opacity, menu_blurring );
+ shader_blitblur_uOverrideDir( menu_blurring );
+
+ if( cl_view_id == 0 )
+ render_fb_bind_texture( gpipeline.fb_main, 0, 0 );
+ else if( cl_view_id == 1 )
+ render_fb_bind_texture( gpipeline.fb_main, 1, 0 );
+ else
+ render_fb_bind_texture( gpipeline.fb_main, 0, 0 );
+
+ render_fb_bind_texture( gpipeline.fb_main, 1, 1 );
+ }
else
+ {
+ shader_blit_use();
+ shader_blit_uTexMain( 0 );
render_fb_bind_texture( gpipeline.fb_main, 0, 0 );
+ }
- render_fb_bind_texture( gpipeline.fb_main, 1, 1 );
render_fsquad();
}
VG_STATIC void render_player_transparent(void)
{
- camera small_cam;
+ static camera small_cam; /* DOES NOT NEED TO BE STATIC BUT MINGW
+ SAIS OTHERWISE */
+
m4x3_copy( main_camera.transform, small_cam.transform );
small_cam.fov = main_camera.fov;
glViewport( 0,0, vg.window_x, vg.window_y );
}
+VG_STATIC void run_light_widget( struct light_widget *lw );
VG_STATIC void vg_ui(void)
{
menu_crap_ui();
-#if 0
- if( lightedit )
+ if( cl_light_edit )
{
- ui_global_ctx.cursor[0] = 10;
- ui_global_ctx.cursor[1] = 10;
- ui_global_ctx.cursor[2] = 200;
- ui_global_ctx.cursor[3] = 20;
+ vg_uictx.cursor[0] = 10;
+ vg_uictx.cursor[1] = 10;
+ vg_uictx.cursor[2] = 200;
+ vg_uictx.cursor[3] = 20;
struct ub_world_lighting *wl = &gpipeline.ub_world_lighting;
struct ui_slider_vector
for( int i=0; i<3; i++ )
run_light_widget( &gpipeline.widgets[i] );
-
- gui_text( ui_global_ctx.cursor, "Ambient", 1, 0 );
- ui_global_ctx.cursor[1] += 16;
- ui_slider_vector( &ui_global_ctx, &s5 );
-
- gui_text( ui_global_ctx.cursor, "Shadows", 1, 0 );
- ui_global_ctx.cursor[1] += 16;
- ui_slider( &ui_global_ctx, &s8 );
- ui_slider( &ui_global_ctx, &s9 );
-
- gui_text( ui_global_ctx.cursor, "Misc", 1, 0 );
- ui_global_ctx.cursor[1] += 16;
+
+ ui_text( vg_uictx.cursor, "Ambient", 1, 0 );
+ vg_uictx.cursor[1] += 16;
+ ui_slider_vector( &s5 );
+
+ ui_text( vg_uictx.cursor, "Shadows", 1, 0 );
+ vg_uictx.cursor[1] += 16;
+ ui_slider( &s8 );
+ ui_slider( &s9 );
+
+ ui_text( vg_uictx.cursor, "Misc", 1, 0 );
+ vg_uictx.cursor[1] += 16;
struct ui_checkbox c1 = {.data = &wl->g_light_preview};
- ui_checkbox( &ui_global_ctx, &c1 );
+ ui_checkbox( &c1 );
render_update_lighting_ub();
}
-#endif
//glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );
if( cl_ui )
audio_debug_soundscapes();
render_view_framebuffer_ui();
+ player_physics_gui();
}
-#if 0
VG_STATIC void run_light_widget( struct light_widget *lw )
{
struct ui_checkbox c1 = { .data=&lw->enabled };
- ui_checkbox( &ui_global_ctx, &c1 );
+ ui_checkbox( &c1 );
if( lw->enabled )
{
colour = { .min=0.0f, .max=2.0f, .len=3, .data=lw->colour },
dir = { .min=-VG_PIf, .max=VG_PIf, .len=2, .data=lw->dir };
- ui_slider_vector( &ui_global_ctx, &colour );
- ui_global_ctx.cursor[1] += 4;
- ui_slider_vector( &ui_global_ctx, &dir );
+ ui_slider_vector( &colour );
+ vg_uictx.cursor[1] += 4;
+ ui_slider_vector( &dir );
}
}
-#endif
VG_STATIC void run_debug_info(void)
{