device_info Function

private function device_info(self) result(info)

The window's Vulkan device and driver (see vkf_diagnostics); '' while it isn't open.

Type Bound

WindowProxy

Arguments

Type IntentOptional Attributes Name
class(WindowProxy), intent(in) :: self

Return Value type(DeviceInfo)


Calls

proc~~device_info~~CallsGraph proc~device_info WindowProxy%device_info interface~vkf_viewer_device_info vkf_viewer_device_info proc~device_info->interface~vkf_viewer_device_info

Source Code

    function device_info(self) result(info)
        class(WindowProxy), intent(in) :: self
        type(DeviceInfo) :: info
        info%name = device_string(1)
        info%kind = device_string(2)
        info%vulkan = device_string(3)
        info%driver = device_string(4)
        info%driver_info = device_string(5)
    contains
        function device_string(which) result(str)
            integer, intent(in) :: which                    !! 1 the name ... 5 the driver's information
            character(len=:), allocatable :: str
            character(kind=c_char, len=256) :: buf
            integer(c_int) :: n
            str = ''
            if (.not. c_associated(self%viewer_)) return
            n = vkf_viewer_device_info(self%viewer_, int(which, c_int), buf, len(buf, kind=c_int))
            if (n > 0) str = trim(buf(1:min(int(n), len(buf))))
        end function device_string
    end function device_info