8cb94f1200fc0615b07f02ae72163aeff6644b09
8 struct input_binding
*bind
;
30 m4x4_zero( ortho
.mtx
.p
);
31 ortho
.mtx
.p
[0][0] = 2.0f
* rl
;
32 ortho
.mtx
.p
[1][1] = 2.0f
* tb
;
33 ortho
.mtx
.p
[3][0] = (fr
+ fl
) * -rl
;
34 ortho
.mtx
.p
[3][1] = (ft
+ fb
) * -tb
;
35 ortho
.mtx
.p
[3][3] = 1.0f
;
36 m4x3_identity( ortho
.transform
);
37 camera_update_view( &ortho
);
38 camera_finalize( &ortho
);
40 gui
.factive
= vg_lerpf( gui
.factive
, gui
.helper_count
?1.0f
:0.0f
,
43 if( gui
.factive
> 0.01f
){
46 glDisable(GL_DEPTH_TEST
);
47 glBlendFunc( GL_SRC_ALPHA
, GL_ONE_MINUS_SRC_ALPHA
);
48 glBlendEquation(GL_FUNC_ADD
);
50 shader_blitcolour_use();
51 shader_blitcolour_uColour( (v4f
){ 0.0f
, 0.0f
, 0.0f
, gui
.factive
*0.8f
} );
55 font3d
*font
= &world_global
.font
;
56 font3d_bind( font
, &ortho
);
59 scale
= dy
*0x1p
-4f
*0.75f
;
63 m3x3_identity( mmdl
);
64 m3x3_scale( mmdl
, (v3f
){scale
,scale
,scale
} );
67 float pad
= dy
*0x1p
-4f
*0.125f
;
68 mmdl
[3][0] = pad
*2.0f
;
71 for( u32 i
=0; i
<gui
.helper_count
; i
++ ){
72 struct gui_helper
*helper
= &gui
.helpers
[i
];
74 shader_model_font_uColour( (v4f
){1.0f
,1.0f
,1.0f
,1.0f
} );
76 float w
= font3d_simple_draw( font
, 2, helper
->text
, &ortho
, mmdl
)+1.0f
;
77 mmdl
[3][0] += w
*scale
;
84 void gui_helper_action( void *bind
, const char *text
)
86 if( gui
.helper_count
>= vg_list_size(gui
.helpers
) )
87 vg_fatal_error( "Too many helpers\n" );
89 struct gui_helper
*helper
= &gui
.helpers
[ gui
.helper_count
++ ];