set_sky Subroutine

private subroutine set_sky(self, sky)

Draw sky behind the scene (it must stay alive while shown; it can be shown in several windows), in place of the window's sky so far; at any time (its texture and stars can change too).

Type Bound

WindowProxy

Arguments

Type IntentOptional Attributes Name
class(WindowProxy), intent(inout) :: self
type(SkySphere), intent(inout), target :: sky

the sky (not owned; can be shown in several windows)


Calls

proc~~set_sky~~CallsGraph proc~set_sky WindowProxy%set_sky interface~vkf_viewer_add_node vkf_viewer_add_node proc~set_sky->interface~vkf_viewer_add_node interface~vkf_viewer_remove_node vkf_viewer_remove_node proc~set_sky->interface~vkf_viewer_remove_node proc~node~2 SkySphere%node proc~set_sky->proc~node~2 interface~vkf_node_add_child vkf_node_add_child proc~node~2->interface~vkf_node_add_child interface~vkf_switch_create vkf_switch_create proc~node~2->interface~vkf_switch_create interface~vkf_transform_create vkf_transform_create proc~node~2->interface~vkf_transform_create proc~check_status check_status proc~node~2->proc~check_status proc~make_line_node make_line_node proc~node~2->proc~make_line_node proc~make_star_node make_star_node proc~node~2->proc~make_star_node proc~make_texture_node make_texture_node proc~node~2->proc~make_texture_node proc~make_line_node->interface~vkf_node_add_child proc~make_line_node->proc~check_status interface~vkf_compile_node vkf_compile_node proc~make_line_node->interface~vkf_compile_node interface~vkf_node_delete vkf_node_delete proc~make_line_node->interface~vkf_node_delete interface~vkf_node_remove_child vkf_node_remove_child proc~make_line_node->interface~vkf_node_remove_child interface~vkf_sky_lines_create vkf_sky_lines_create proc~make_line_node->interface~vkf_sky_lines_create interface~vkf_sky_stars vkf_sky_stars proc~make_line_node->interface~vkf_sky_stars interface~vkf_sky_stars_changed vkf_sky_stars_changed proc~make_line_node->interface~vkf_sky_stars_changed interface~vkf_sky_style vkf_sky_style proc~make_line_node->interface~vkf_sky_style proc~apply_attitude apply_attitude proc~make_line_node->proc~apply_attitude proc~apply_mode apply_mode proc~make_line_node->proc~apply_mode proc~make_star_node->interface~vkf_node_add_child proc~make_star_node->proc~check_status proc~make_star_node->interface~vkf_compile_node proc~make_star_node->interface~vkf_node_delete proc~make_star_node->interface~vkf_node_remove_child proc~make_star_node->interface~vkf_sky_stars proc~make_star_node->interface~vkf_sky_stars_changed interface~vkf_stars_create vkf_stars_create proc~make_star_node->interface~vkf_stars_create proc~make_star_node->proc~apply_attitude proc~make_star_node->proc~apply_mode proc~make_name_node make_name_node proc~make_star_node->proc~make_name_node proc~make_texture_node->interface~vkf_node_add_child proc~make_texture_node->proc~check_status proc~make_texture_node->interface~vkf_compile_node proc~make_texture_node->interface~vkf_node_delete proc~make_texture_node->interface~vkf_node_remove_child interface~vkf_sky_texture_create vkf_sky_texture_create proc~make_texture_node->interface~vkf_sky_texture_create proc~make_texture_node->proc~apply_attitude proc~make_texture_node->proc~apply_mode proc~apply_attitude->proc~check_status proc~apply_attitude->interface~vkf_sky_style interface~vkf_sky_style_changed vkf_sky_style_changed proc~apply_attitude->interface~vkf_sky_style_changed proc~quat_to_matrix quat_to_matrix proc~apply_attitude->proc~quat_to_matrix proc~apply_mode->proc~check_status interface~vkf_switch_set vkf_switch_set proc~apply_mode->interface~vkf_switch_set proc~make_name_node->interface~vkf_node_add_child proc~make_name_node->interface~vkf_transform_create proc~make_name_node->proc~check_status proc~make_name_node->interface~vkf_compile_node proc~make_name_node->interface~vkf_node_delete proc~make_name_node->interface~vkf_node_remove_child proc~make_name_node->proc~apply_mode interface~vkf_label_set_at_infinity vkf_label_set_at_infinity proc~make_name_node->interface~vkf_label_set_at_infinity proc~apply_name_attitude apply_name_attitude proc~make_name_node->proc~apply_name_attitude proc~label_create label_create proc~make_name_node->proc~label_create proc~apply_name_attitude->proc~check_status proc~apply_name_attitude->proc~quat_to_matrix interface~vkf_transform_set_matrix vkf_transform_set_matrix proc~apply_name_attitude->interface~vkf_transform_set_matrix interface~vkf_label_create vkf_label_create proc~label_create->interface~vkf_label_create proc~get_font get_font proc~label_create->proc~get_font proc~vsg_alignment vsg_alignment proc~label_create->proc~vsg_alignment interface~vkf_font_read vkf_font_read proc~get_font->interface~vkf_font_read proc~find_font find_font proc~get_font->proc~find_font proc~find_in_dirs find_in_dirs proc~find_font->proc~find_in_dirs

Source Code

    subroutine set_sky(self, sky)
        class(WindowProxy), intent(inout) :: self
        type(SkySphere), intent(inout), target :: sky       !! the sky (not owned; can be shown in several windows)
        integer(c_int) :: status
        if (self%scene_added) then                      ! shown: swap the sky's node
            if (associated(self%sky_)) status = vkf_viewer_remove_node(self%viewer_, self%sky_%node(self%viewer_))
            if (vkf_viewer_add_node(self%viewer_, sky%node(self%viewer_)) /= 0) &
                write(*, '(a)') 'vkframes: could not add the sky'
        end if
        self%sky_ => sky
    end subroutine set_sky