}
VG_STATIC int render_framebuffer_control( int argc, char const *argv[] );
+VG_STATIC void render_framebuffer_poll( int argc, char const *argv[] );
VG_STATIC void render_init_fs_quad(void)
{
vg_info( "[render] Allocate quad\n" );
vg_function_push( (struct vg_cmd)
{
.name = "fb",
- .function = render_framebuffer_control
+ .function = render_framebuffer_control,
+ .poll_suggest = render_framebuffer_poll
});
glGenVertexArrays( 1, &gpipeline.fsquad.vao );
return 0;
}
+VG_STATIC void render_framebuffer_poll( int argc, char const *argv[] )
+{
+ const char *term = argv[argc-1];
+
+ if( argc == 1 )
+ {
+ console_suggest_score_text( "show", term, 0 );
+ console_suggest_score_text( "hide", term, 0 );
+ }
+ else if( argc == 2 )
+ {
+ console_suggest_score_text( "all", term, 0 );
+
+ for( int i=0; i<vg_list_size(framebuffers); i++ )
+ {
+ struct framebuffer *fb = &framebuffers[i];
+ console_suggest_score_text( fb->display_name, term, 0 );
+ }
+ }
+ else if( argc == 3 )
+ {
+ int modify_all = 0;
+
+ if( !strcmp( argv[1], "all" ) )
+ modify_all = 1;
+
+ for( int i=0; i<vg_list_size(framebuffers); i++ )
+ {
+ struct framebuffer *fb = &framebuffers[i];
+
+ for( int j=0; j<vg_list_size(fb->attachments); j++ )
+ {
+ struct framebuffer_attachment *at = &fb->attachments[j];
+
+ if( at->purpose == k_framebuffer_attachment_type_none )
+ continue;
+
+ if( modify_all )
+ {
+ console_suggest_score_text( at->display_name, term, 0 );
+ }
+ else if( !strcmp( fb->display_name, argv[1] ) )
+ {
+ console_suggest_score_text( at->display_name, term, 0 );
+ }
+ }
+ }
+ }
+}
+
#endif /* RENDER_H */