add_hud_text Subroutine

private subroutine add_hud_text(self, h)

Show h in the window, on top of the scene (it must stay alive while shown), from the next frame.

Type Bound

WindowProxy

Arguments

Type IntentOptional Attributes Name
class(WindowProxy), intent(inout) :: self
type(HUDText), intent(in), target :: h

the text (not owned)


Calls

proc~~add_hud_text~~CallsGraph proc~add_hud_text WindowProxy%add_hud_text proc~create_hud create_hud proc~add_hud_text->proc~create_hud interface~vkf_viewer_hud_add vkf_viewer_hud_add proc~create_hud->interface~vkf_viewer_hud_add proc~alignment HUDText%alignment proc~create_hud->proc~alignment proc~color HUDText%color proc~create_hud->proc~color proc~font HUDText%font proc~create_hud->proc~font proc~label_create label_create proc~create_hud->proc~label_create proc~position HUDText%position proc~create_hud->proc~position proc~revision HUDText%revision proc~create_hud->proc~revision proc~text~2 HUDText%text proc~create_hud->proc~text~2 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 add_hud_text(self, h)
        class(WindowProxy), intent(inout) :: self
        type(HUDText), intent(in), target :: h              !! the text (not owned)
        type(HUDEntry), allocatable :: tmp(:)
        if (.not. allocated(self%huds)) allocate(self%huds(4))
        if (self%n_huds == size(self%huds)) then
            allocate(tmp(2 * self%n_huds))
            tmp(1:self%n_huds) = self%huds(1:self%n_huds)
            call move_alloc(tmp, self%huds)
        end if
        self%n_huds = self%n_huds + 1
        self%huds(self%n_huds)%p => h
        self%huds(self%n_huds)%node = c_null_ptr
        self%huds(self%n_huds)%revision = -1
        if (self%scene_added) call create_hud(self, self%n_huds)    ! shown: made now
    end subroutine add_hud_text