Fortran interfaces to the C++ VSG layer (src/vsg/vkf_layer.cpp, with src/vsg/vkf_rocky.cpp for Rocky maps and src/vsg/vkf_gui.cpp for GUI panels), and a few helpers that fill the layer's buffers in place.
Objects are opaque type(c_ptr) handles owned by the layer; release each
one with its *_delete routine. Strings cross as (pointer, length).
Functions returning integer(c_int) return 0 on success and -1 on failure
unless documented otherwise; those returning a handle return null on failure.
Delete the cache's files (converted fonts, compiled shaders; nothing else), and its fonts and shaders directories if left empty (not the cache directory). Returns the number of files removed, or -1 if some couldn't be.
The cache directory (src/vsg/vkf_cache.h: VKFRAMES_CACHE_DIR, or the user's cache directory;
created if it doesn't exist) into buf (not null-terminated); returns its length (0: none, or
it can't be created), or -1 if buf is too short.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(kind=c_char, len=1), | intent(out), | dimension(*) | :: | buf |
the directory (not null-terminated) |
|
| integer(kind=c_int), | value | :: | buflen |
the length of |
Compile a node for the running viewers (to add it to a shown scene). Viewers not yet running compile it with their scene at their first frame. Returns 0 on success.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | node |
node handle |
Start loading the Vulkan driver, on a thread of its own, for the first window (see DriverPreload in vkf_layer.cpp): called when a scene is set up, before its window opens.
Delete a font handle.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | font |
font handle (vkf_font_read) |
Read a font file (TrueType, ... through vsgXchange's freetype): a font handle, or null on failure. Converting a font takes seconds, so the result is cached and read from there next time.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(kind=c_char, len=1), | intent(in), | dimension(*) | :: | filename | ||
| integer(kind=c_int), | value | :: | filename_len |
the length of |
Begin a panel: the widgets up to vkf_gui_end are in it.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | gui |
GUI handle (vkf_viewer_gui) |
||
| character(kind=c_char, len=1), | intent(in) | :: | title(*) |
panel title ("##name": no title bar, e.g. a callout) |
||
| integer(kind=c_int), | value | :: | title_len |
the length of |
||
| real(kind=c_double), | value | :: | x |
position (0 to 1 across the window, y up; x < 0: where ImGui puts it) |
||
| real(kind=c_double), | value | :: | y |
position (0 to 1 across the window, y up; x < 0: where ImGui puts it) |
||
| real(kind=c_double), | value | :: | pivot_x |
the panel's point placed there (0 to 1 across it, from the top left) |
||
| real(kind=c_double), | value | :: | pivot_y |
the panel's point placed there (0 to 1 across it, from the top left) |
||
| integer(kind=c_int), | value | :: | follow |
not 0: placed at (x, y) every frame (and not movable), else only at first |
A button: 1 if it was clicked since the last call for it (in this panel), else 0.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | gui |
GUI handle (vkf_viewer_gui) |
||
| character(kind=c_char, len=1), | intent(in) | :: | label(*) | |||
| integer(kind=c_int), | value | :: | label_len |
the length of |
A checkbox showing value: 1 (and value set) if the user changed it since the last call for it, else 0.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | gui |
GUI handle (vkf_viewer_gui) |
||
| character(kind=c_char, len=1), | intent(in) | :: | label(*) | |||
| integer(kind=c_int), | value | :: | label_len |
the length of |
||
| integer(kind=c_int), | intent(inout) | :: | value |
1 checked, 0 not |
A combo box (drop-down menu) of items (newline-separated), showing item index (0-based): 1 (and
index set) if the user chose another since the last call for it, else 0.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | gui |
GUI handle (vkf_viewer_gui) |
||
| character(kind=c_char, len=1), | intent(in) | :: | label(*) | |||
| integer(kind=c_int), | value | :: | label_len |
the length of |
||
| integer(kind=c_int), | intent(inout) | :: | index | |||
| character(kind=c_char, len=1), | intent(in) | :: | items(*) | |||
| integer(kind=c_int), | value | :: | items_len |
the length of |
End the panel begun by vkf_gui_begin.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | gui |
GUI handle (vkf_viewer_gui) |
Put the next widget on the same line as the last one.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | gui |
GUI handle (vkf_viewer_gui) |
A horizontal separator in the current panel.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | gui |
GUI handle (vkf_viewer_gui) |
A slider showing value from low to high (as format, printf's; empty: "%.4g"): 1 (and value
set) if the user changed it since the last call for it, else 0.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | gui |
GUI handle (vkf_viewer_gui) |
||
| character(kind=c_char, len=1), | intent(in) | :: | label(*) | |||
| integer(kind=c_int), | value | :: | label_len |
the length of |
||
| real(kind=c_double), | intent(inout) | :: | value | |||
| real(kind=c_double), | value | :: | low |
the slider's range |
||
| real(kind=c_double), | value | :: | high |
the slider's range |
||
| character(kind=c_char, len=1), | intent(in) | :: | format(*) | |||
| integer(kind=c_int), | value | :: | format_len |
the length of |
A line of text in the current panel.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | gui |
GUI handle (vkf_viewer_gui) |
||
| character(kind=c_char, len=1), | intent(in) | :: | text(*) | |||
| integer(kind=c_int), | value | :: | text_len |
the length of |
Delete an image handle.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | image |
image handle (vkf_image_read) |
Read an image file (png, jpg, ...): an image handle, or null on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(kind=c_char, len=1), | intent(in), | dimension(*) | :: | filename | ||
| integer(kind=c_int), | value | :: | filename_len |
the length of |
A label (a node handle): text at position, facing the screen; null on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | font |
font handle (vkf_font_read) |
||
| character(kind=c_char, len=1), | intent(in), | dimension(*) | :: | text | ||
| integer(kind=c_int), | value | :: | text_len |
the length of |
||
| real(kind=c_float), | intent(in), | dimension(4) | :: | rgba |
color (rgba, 0 to 1) |
|
| real(kind=c_double), | intent(in), | dimension(3) | :: | position |
in its parent's coordinates |
|
| real(kind=c_float), | value | :: | size |
|
||
| real(kind=c_float), | value | :: | max_size |
the most window units tall on screen ( |
||
| integer(kind=c_int), | value | :: | halign |
(vsg::StandardLayout's alignments (0 baseline, 1 left/top, 2 center, 3 right/bottom)) |
||
| integer(kind=c_int), | value | :: | valign |
(vsg::StandardLayout's alignments (0 baseline, 1 left/top, 2 center, 3 right/bottom)) |
Draw a label at infinity (on /= 0: its position a direction, in its parent's axes; at the far plane, behind the scene, as the sky's stars) or at its position (0). Returns 0, or -1 if not a label.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | label |
label handle (vkf_label_create) |
||
| integer(kind=c_int), | value | :: | on |
1: at infinity; 0: at its position |
Change a label's color. Returns 0, or -1 on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | label |
label handle (vkf_label_create) |
||
| real(kind=c_float), | intent(in), | dimension(4) | :: | rgba |
color (rgba, 0 to 1) |
Change a label's layout, in place. Returns 0, or -1 on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | label |
label handle (vkf_label_create) |
||
| real(kind=c_double), | intent(in) | :: | position(3) |
as vkf_label_create's |
||
| real(kind=c_float), | value | :: | size |
as vkf_label_create's |
||
| real(kind=c_float), | value | :: | max_size |
as vkf_label_create's |
||
| integer(kind=c_int), | value | :: | halign |
as vkf_label_create's |
||
| integer(kind=c_int), | value | :: | valign |
as vkf_label_create's |
Draw a label on top of the scene (at the near plane, as HUD labels: not hidden by what is in front of it) or depth-tested. Returns 0, or -1 on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | label |
label handle (vkf_label_create) |
||
| integer(kind=c_int), | value | :: | on |
not 0: on top; 0: depth-tested |
Change a label's text, in place: a text longer than the label's capacity (glyphs allocated when it was made) is cut to it, with a warning. Returns 0, or -1 on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | label |
label handle (vkf_label_create) |
||
| character(kind=c_char, len=1), | intent(in), | dimension(*) | :: | text | ||
| integer(kind=c_int), | value | :: | text_len |
the length of |
A light (a node handle), initially a directional light along -z (in its node's coordinates) of white diffuse color and no ambient or specular part; null on failure.
Set a light's colors and position, in its node's coordinates. Returns 0 (-1 for a bad handle).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | light |
light handle (vkf_light_create, vkf_viewer_light) |
||
| real(kind=c_float), | intent(in), | dimension(3) | :: | ambient |
colors (rgb, 0 to 1) |
|
| real(kind=c_float), | intent(in), | dimension(3) | :: | diffuse |
colors (rgb, 0 to 1) |
|
| real(kind=c_float), | intent(in), | dimension(3) | :: | specular |
colors (rgb, 0 to 1) |
|
| real(kind=c_double), | intent(in), | dimension(4) | :: | position |
OpenGL's (x, y, z, w): w = 0 for a directional light from direction (x, y, z), else a point light at (x/w, y/w, z/w) |
The colors (4 floats per point) of a line made by vkf_line_create_colored (null for others).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | line |
line or ribbon handle |
||
| integer(kind=c_int), | intent(out) | :: | capacity |
the buffer's capacity (points) |
A line strip holding up to capacity points (initially none): a node handle, or null on failure.
Fortran fills its point and style buffers in place (vkf_line_points, vkf_line_style), then calls
vkf_line_points_changed / vkf_line_style_changed. It can be shown in any number of windows.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=c_int), | value | :: | capacity |
the most points |
A line with a color per point (vkf_line_colors), blended along each segment. A node handle, or null on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=c_int), | value | :: | capacity |
the most points |
A line's point buffer, 8 floats per point (x, y, z and the distance along the strip from its start, high parts, then their low parts; see shaders/line.vert; markers ignore the distance), to fill in place; valid while the line handle exists. Null on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | line |
line, marker or ribbon handle |
||
| integer(kind=c_int), | intent(out) | :: | capacity |
the buffer's capacity (points) |
The first n points of the buffer have been written: draw n points and upload the buffer.
Returns 0, or -1 if n exceeds the capacity.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | line |
line, marker or ribbon handle |
||
| integer(kind=c_int), | value | :: | n |
the number of points |
A line's dashes: screen 1 screen-locked (a constant length in pixels, following the line on
screen), 0 anchored to the line (the default). Returns 0, or -1 if line isn't a line.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | line |
line handle |
||
| integer(kind=c_int), | value | :: | mode |
0 anchored, 1 screen-locked, 2 a fixed length |
||
| real(kind=c_double), | value | :: | length |
(2) the pattern's length, scene units (0: from the first view) |
Set a line's highlight (shaders/line.vert) and upload it: values
are its color (rgba), (flags: 1 pulse, 2 arrows; arrow spacing
(window units), arrow speed (window units per second), band width
(window units)), (pulse period (s), 0, 0, 0). Returns 0, or -1 if
line isn't a line.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | line |
line handle |
||
| real(kind=c_float), | intent(in), | dimension(12) | :: | values |
A line strip's level of detail: the bounding sphere of its points and error(k): how far the points skipped can be from the segments drawn at stride 2^k (k = 1 .. levels). Returns 0, or -1 on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | line |
line handle |
||
| real(kind=c_double), | intent(in), | dimension(3) | :: | center |
bounding sphere center |
|
| real(kind=c_double), | value | :: | radius |
bounding sphere radius |
||
| real(kind=c_float), | intent(in), | dimension(*) | :: | error |
(levels), in the points' units |
|
| integer(kind=c_int), | value | :: | levels |
(0: all points drawn) |
Draw only points first .. first+n-1 (no data is uploaded): e.g. for trace mode.
(Separate segments: first odd, n even.) Returns 0, or -1 on failure (out of range).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | line |
line, marker or ribbon handle |
||
| integer(kind=c_int), | value | :: | first |
the first point (1-based) and the number of points |
||
| integer(kind=c_int), | value | :: | n |
the first point (1-based) and the number of points |
Set a line strip's trail (shaders/line.vert) and upload it: values
are (the distance at the current time as a high/low pair, the
direction (1, -1; 0: no trail), the color flags), (the past's cutoff
and fade start, the future's fade start and cutoff: distances from the
current time's), the past's color (rgba), the future's, (the past's
dash pattern and factor, the future's). Returns 0, or -1 if line
isn't a line strip.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | line |
line handle |
||
| real(kind=c_float), | intent(in), | dimension(20) | :: | values |
A line's style buffer: 8 floats (r, g, b, a, width in window units, 1 for separate segments (pairs of points) or 0 for a strip, the dash pattern (16 bits; 65535 or 0: solid), window units per bit of it). Set the segment flag before drawing points. Null on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | line |
line, marker or ribbon handle |
Upload a line's style again after writing it (vkf_line_style). Returns 0, or -1 on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | line |
line, marker or ribbon handle |
Markers at up to capacity points (initially none): a screen-space quad per point, of the shape and
size in the style buffer (shaders/marker.vert); a node handle, or null on failure. The point and style
buffers are those of a line (vkf_line_points, vkf_line_style, vkf_line_points_changed,
vkf_line_set_range, vkf_line_style_changed); with colored (1), a color per marker
(vkf_line_colors), times the style's.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=c_int), | value | :: | capacity |
the most points |
||
| type(c_ptr), | value | :: | image |
image handle (vkf_image_read) for the image shape, or null |
||
| integer(kind=c_int), | value | :: | colored |
1: a color per marker, 0: the style's only |
One of the mesh's arrays, to fill in place; valid while the mesh handle exists.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | mesh |
mesh handle (vkf_mesh_create) |
||
| integer(kind=c_int), | value | :: | which |
1 = vertices (3 floats each), 2 = normals (3 floats), 3 = texture coordinates (2 floats), 4 = triangle indices (uint32, 0-based) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=c_int), | value | :: | n_vertices |
number of vertices |
||
| integer(kind=c_int), | value | :: | n_indices |
number of triangle indices |
||
| real(kind=c_float), | intent(in), | dimension(4) | :: | rgba |
color (rgba, 0 to 1; multiplies the texture) |
|
| type(c_ptr), | value | :: | texture |
image handles (vkf_image_read), or null |
||
| type(c_ptr), | value | :: | night_texture |
image handles (vkf_image_read), or null |
||
| integer(kind=c_int), | value | :: | flags |
1 for an unlit transparent surface (no textures), 2 for view lighting (frames' axes), else lit by the scene's lights with a material (vkf_mesh_material); plus 4 for vertices that change after the mesh is compiled (rewritten in place, then vkf_mesh_vertices_changed); plus 8 for a lit translucent surface (depth sorted: vkf_mesh_set_bound); plus 16 two-sided (lit: no faces culled); plus 32 a color per vertex (vkf_mesh_array 5; rgba each one's initial color) |
The material of a lit mesh: 19 floats (vsg::PhongMaterial: ambient, diffuse, specular, emissive rgba, shininess, alpha mask, alpha mask cutoff); call vkf_mesh_material_changed after writing them. Null for a mesh without one.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | mesh |
mesh handle (vkf_mesh_create) |
Upload a mesh's material again after writing it (vkf_mesh_material). Returns 0, or -1 on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | mesh |
mesh handle (vkf_mesh_create) |
A triangle mesh (a node handle), filled from Fortran (vkf_mesh_array, before the first frame); null on failure. A translucent mesh's bounding sphere (its coordinates), for depth sorting and culling. Returns 0, or -1 if it isn't a translucent mesh (vkf_mesh_create's flag 8).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | mesh |
mesh handle (vkf_mesh_create) |
||
| real(kind=c_double), | value | :: | x |
the bound's center and radius |
||
| real(kind=c_double), | value | :: | y |
the bound's center and radius |
||
| real(kind=c_double), | value | :: | z |
the bound's center and radius |
||
| real(kind=c_double), | value | :: | radius |
the bound's center and radius |
A lit mesh's twilight: its diffuse light extended to angle (radians)
past the terminator, fading out (0: none).
Returns 0, or -1 on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | mesh |
mesh handle (vkf_mesh_create) |
||
| real(kind=c_float), | value | :: | angle |
radians |
Upload a mesh's vertices again after rewriting them in place (a mesh created with flag 4). Returns 0, or -1 on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | mesh |
mesh handle (vkf_mesh_create) |
Read a model file (3ds, obj, gltf, ...): a node handle, or null on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(kind=c_char, len=1), | intent(in), | dimension(*) | :: | filename | ||
| integer(kind=c_int), | value | :: | filename_len |
the length of |
Add a child to a group node (a transform or a switch); while running, compile the child first (vkf_compile_node). Returns 0, or -1 on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | parent |
node handles |
||
| type(c_ptr), | value | :: | child |
node handles |
Bounding sphere of a node in its own coordinates. Returns 0, or -1 if the node is empty.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | node |
node handle |
||
| real(kind=c_double), | intent(out), | dimension(3) | :: | center | ||
| real(kind=c_double), | intent(out) | :: | radius |
Delete a node handle (a scene or parent that holds the node keeps it).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | node |
node handle |
Remove a child from a group node (a transform or a switch), also while running: its GPU data are released a few frames later. Returns 0, or -1 if it is not a child.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | parent |
node handles |
||
| type(c_ptr), | value | :: | child |
node handles |
A ribbon of up to capacity points (even): a translucent surface through
pairs of points, a quad between each pair and the next; a color per
point (vkf_line_colors) if colored is not 0. The buffers are a line's.
A node handle, or null on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=c_int), | value | :: | capacity |
the most points (even) |
||
| integer(kind=c_int), | value | :: | colored |
not 0: a color per point |
Add an elevation layer to a map. Returns 0, or -1 on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | map |
map handle (vkf_rocky_map_create) |
||
| integer(kind=c_int), | value | :: | kind |
as vkf_rocky_add_image's |
||
| character(kind=c_char, len=1), | intent(in), | dimension(*) | :: | uri | ||
| integer(kind=c_int), | value | :: | uri_len |
the length of |
||
| integer(kind=c_int), | value | :: | encoding |
0 single-channel heights (meters), 1 Mapbox RGB, 2 Terrarium RGB |
Add an image layer to a map. Returns 0, or -1 on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | map |
map handle (vkf_rocky_map_create) |
||
| integer(kind=c_int), | value | :: | kind |
0 a TMS service ( |
||
| character(kind=c_char, len=1), | intent(in), | dimension(*) | :: | uri | ||
| integer(kind=c_int), | value | :: | uri_len |
the length of |
1 if vkframes was built with Rocky, else 0.
The height (meters) of the elevation data in a file (GDAL) at a latitude and longitude on the body of a Rocky profile, sampled directly (no map or window needed; files are kept open for later samples).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(kind=c_char, len=1), | intent(in), | dimension(*) | :: | uri |
the file, and the profile (as vkf_rocky_map_create) |
|
| integer(kind=c_int), | value | :: | uri_len |
the lengths of |
||
| character(kind=c_char, len=1), | intent(in), | dimension(*) | :: | profile |
the file, and the profile (as vkf_rocky_map_create) |
|
| integer(kind=c_int), | value | :: | profile_len |
the lengths of |
||
| real(kind=c_double), | value | :: | lat |
latitude and longitude (degrees) |
||
| real(kind=c_double), | value | :: | lon |
latitude and longitude (degrees) |
||
| integer(kind=c_int), | intent(out) | :: | ok |
1 if there was data there |
1 while a map can be drawn (the viewer it was made for exists), else 0.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | map |
map handle (vkf_rocky_map_create) |
A map for the viewer (a node handle: vkf_node_*); null without Rocky or on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | viewer |
viewer handle (vkf_viewer_create) |
||
| character(kind=c_char, len=1), | intent(in), | dimension(*) | :: | profile |
Rocky's profile (e.g. "global-geodetic", "global-qsc", "moon"; empty: Rocky's default) |
|
| integer(kind=c_int), | value | :: | profile_len |
the length of |
||
| real(kind=c_double), | value | :: | scale |
scene units per meter |
The equatorial radius of a map's body (meters); 0 without Rocky or on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | map |
map handle (vkf_rocky_map_create) |
A map's settings. Returns 0, or -1 on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | map |
map handle (vkf_rocky_map_create) |
||
| integer(kind=c_int), | value | :: | lighting |
(1: lit by the scene's lights, as vkframes' spheres; 0: imagery as is (Rocky's default)) |
||
| real(kind=c_float), | intent(in), | dimension(4) | :: | background |
the color where there is no imagery (rgba, 0 to 1) |
Lines on the sky (up to capacity; initially none; e.g. constellations): segments between
directions, of the color and width of the style's parameters (vkf_sky_style). A node handle, or null on
failure. Fortran fills the buffer as the stars' (vkf_sky_stars: 8 floats per line, its first direction
x, y, z, unused, then its second) and calls vkf_sky_stars_changed.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=c_int), | value | :: | capacity |
the most lines |
The stars' buffer, 8 floats per star (direction x, y, z, size in window units, then r, g, b, unused), to fill in place; null for a sky texture.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | node |
stars or lines handle (vkf_stars_create, vkf_sky_lines_create) |
||
| integer(kind=c_int), | intent(out) | :: | capacity |
the buffer's capacity (stars or lines) |
The first n stars were written: draw them, and upload the buffer. Returns 0, or -1 on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | node |
stars handle (vkf_stars_create) |
||
| integer(kind=c_int), | value | :: | n |
the number of stars (at most the capacity) |
The sky's style buffer: 24 floats, the attitude (a column-major 4x4 matrix, sky frame to root frame), then 8 parameters (lines: width in window units, 3 unused, then the color r, g, b, a; unused by stars and the texture); call vkf_sky_style_changed after writing them. Null on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | node |
sky handle (vkf_stars_create, vkf_sky_texture_create) |
Upload a sky's style again after writing it (vkf_sky_style). Returns 0, or -1 on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | node |
sky handle (vkf_stars_create, vkf_sky_texture_create) |
The sky texture: an image (equirectangular, as a Sphere's texture) on the sky seen from inside; a node handle, or null on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | image |
image handle (vkf_image_read) |
Add a mesh of segments segments around the equator. Returns 0, or -1 on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | lod |
handles (vkf_sphere_lod_create, vkf_mesh_create) |
||
| type(c_ptr), | value | :: | mesh |
handles (vkf_sphere_lod_create, vkf_mesh_create) |
||
| integer(kind=c_int), | value | :: | segments |
A sphere's level of detail for a body of radius (its largest semi-axis), centered on the node's
origin: a node handle; meshes are added with vkf_sphere_lod_add.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=c_double), | value | :: | radius |
scene units |
The most segments any view wanted since the last call (0 if not drawn).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | lod |
handle (vkf_sphere_lod_create) |
Stars (up to capacity; initially none): a node handle, or null on failure. Fortran fills the
buffer in place (vkf_sky_stars) and calls vkf_sky_stars_changed.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=c_int), | value | :: | capacity |
the most stars |
A switch node: a group whose children can be hidden and shown together; null on failure.
Show or hide all children of a switch. Returns 0, or -1 on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | node |
switch handle (vkf_switch_create) |
||
| integer(kind=c_int), | value | :: | visible |
1 to show, 0 to hide |
A transform node (a group whose children are placed by a 4x4 matrix), initially identity; null on failure.
Set a transform node's matrix. Returns 0, or -1 on failure (not a transform).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | transform |
transform handle (vkf_transform_create) |
||
| real(kind=c_double), | intent(in), | dimension(4,4) | :: | m |
A version string into buf (blank-padded): which = 1 VSG, 2 vsgXchange, 3 Dear ImGui, 4 the Vulkan
headers vkframes was built with, 5 the Vulkan loader's instance version. Returns its length, or -1.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=c_int), | value | :: | which |
1 to 5 (see above) |
||
| character(kind=c_char, len=1), | intent(out) | :: | buf(*) | |||
| integer(kind=c_int), | value | :: | buflen |
the length of |
Add a node to the viewer's scene, also while running (it is compiled first). The scene holds a reference: the node handle can be deleted afterwards. Returns 0, or -1 on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | viewer |
viewer handle (vkf_viewer_create) and node handle |
||
| type(c_ptr), | value | :: | node |
viewer handle (vkf_viewer_create) and node handle |
A viewer that exists (the oldest running one, else the oldest), or null.
Write the last presented frame to an image file (format from the extension, e.g. .png). Call after vkf_viewer_frame. Returns 0 on success.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | viewer |
viewer handle (vkf_viewer_create) |
||
| character(kind=c_char, len=1), | intent(in), | dimension(*) | :: | filename | ||
| integer(kind=c_int), | value | :: | filename_len |
the length of |
The host is closing the window: the next vkf_viewer_frame returns 0. Returns 0, or -1 on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | viewer |
viewer handle (vkf_viewer_create) |
A viewer with one window, an empty scene and a trackball camera; null on failure.
With an existing window (native_window not 0) the host owns that window's events and
forwards them (vkf_viewer_mouse, ..., vkf_viewer_resize).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=c_int), | value | :: | width |
window size (window units: logical pixels) |
||
| integer(kind=c_int), | value | :: | height |
window size (window units: logical pixels) |
||
| character(kind=c_char, len=1), | intent(in), | dimension(*) | :: | title |
window title |
|
| integer(kind=c_int), | value | :: | title_len |
the length of |
||
| integer(kind=c_long_long), | value | :: | native_window |
0 for a window of its own, or the native handle of an existing window to render into (e.g. a Qt QWindow's winId(): an NSView* on macOS, an HWND on Windows, an xcb window on Linux) |
||
| real(kind=c_double), | value | :: | pixel_ratio |
framebuffer pixels per window unit of an existing window (Qt's devicePixelRatio); ignored for a window of its own |
||
| integer(kind=c_int), | value | :: | vsync |
1 to present at the display's refresh (FIFO), 0 as soon as a frame is ready (IMMEDIATE where the driver has it, else FIFO), e.g. for benchmarks |
Delete a viewer (its window, GUI and default light; waits for the device to be idle first).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | viewer |
viewer handle (vkf_viewer_create) |
The viewer's Vulkan device into buf (blank-padded): which = 1 its name, 2 its type, 3 the Vulkan
version it supports, 4 its driver's name, 5 its driver's information. Returns the length, or -1.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | viewer |
viewer handle (vkf_viewer_create) |
||
| integer(kind=c_int), | value | :: | which |
1 to 5 (see above) |
||
| character(kind=c_char, len=1), | intent(out) | :: | buf(*) | |||
| integer(kind=c_int), | value | :: | buflen |
the length of |
The keyboard and mouse events since the last call, oldest first, up to capacity of them.
Returns how many were copied (the rest are kept for the next call), or -1 on failure.
Each event (a column of events): kind (1 key press, 2 key release, 3 pointer move, 4 button press,
5 button release), key (modified: 'V' with shift), key base, modifiers, button, buttons held (mask),
x, y (framebuffer pixels from the top left), and the render area (offset x, y, width, height).
Pointer events have key 1 while the mouse is grabbed (vkf_viewer_set_grab). Events taken by a
GUI panel are not included.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | viewer |
viewer handle (vkf_viewer_create) |
||
| integer(kind=c_int), | intent(out) | :: | events(12,*) |
the events, 12 integers each |
||
| integer(kind=c_int), | value | :: | capacity |
the most events |
Render one frame (vkf_viewer_frame_begin, then vkf_viewer_frame_draw). Returns 1 while the viewer is running, 0 once its window has been closed, -1 on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | viewer |
viewer handle (vkf_viewer_create) |
The first part of a frame (compiling the scene on the first call): up to the window's events handled (the trackball has moved the camera), before the scene is drawn (vkf_viewer_frame_draw): a program can still change the scene for this frame in between. Returns 1 while the viewer is running, 0 once its window has been closed, -1 on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | viewer |
viewer handle (vkf_viewer_create) |
The rest of a frame begun by vkf_viewer_frame_begin: the scene's updates, drawn and presented. Returns 1, or -1 on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | viewer |
viewer handle (vkf_viewer_create) |
The camera's eye, center and up vectors (view-frame coordinates), as the trackball left them. Returns 0, or -1 on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | viewer |
viewer handle (vkf_viewer_create) |
||
| real(kind=c_double), | intent(out), | dimension(3) | :: | eye |
view-frame coordinates |
|
| real(kind=c_double), | intent(out), | dimension(3) | :: | center |
view-frame coordinates |
|
| real(kind=c_double), | intent(out), | dimension(3) | :: | up |
view-frame coordinates |
The viewer's GUI panels (vkf_gui.cpp), made on first use: a handle for the vkf_gui_* functions, valid while the viewer exists; null on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | viewer |
viewer handle (vkf_viewer_create) |
||
| character(kind=c_char, len=1), | intent(in) | :: | font(*) |
font file (empty: ImGui's) |
||
| integer(kind=c_int), | value | :: | font_len |
the length of |
||
| real(kind=c_double), | value | :: | size |
font size (window units) |
Show a label in the viewer's HUD, on top of the scene, also while running: the label's position is (x, y) from 0 to 1 across the viewport, bottom to top. Returns 0, or -1 on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | viewer |
viewer handle (vkf_viewer_create) and label handle |
||
| type(c_ptr), | value | :: | label |
viewer handle (vkf_viewer_create) and label handle |
Remove a label from the viewer's HUD (its GPU data are released a few frames later). Returns 0, or -1 on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | viewer |
viewer handle (vkf_viewer_create) and label handle |
||
| type(c_ptr), | value | :: | label |
viewer handle (vkf_viewer_create) and label handle |
A key press or release from the host's window, as VSG key symbols and modifiers (vsg/ui/KeyEvent.h: ASCII for printable keys, X11-style codes otherwise). Returns 0, or -1 on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | viewer |
viewer handle (vkf_viewer_create) |
||
| integer(kind=c_int), | value | :: | pressed |
1 for a press, 0 for a release |
||
| integer(kind=c_int), | value | :: | symbol |
the key's base symbol (unmodified) |
||
| integer(kind=c_int), | value | :: | modified_symbol |
the key's symbol with the modifiers applied ('V' with shift) |
||
| integer(kind=c_int), | value | :: | modifier |
the modifier keys held (vsg::KeyModifier mask) |
The viewer's default light (a vkf_light_create light in eye coordinates, owned by the viewer); null on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | viewer |
viewer handle (vkf_viewer_create) |
Turn the viewer's default light on or off. Returns 0, or -1 on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | viewer |
viewer handle (vkf_viewer_create) |
||
| integer(kind=c_int), | value | :: | enabled |
1 on, 0 off |
Set the camera's eye, center and up vectors (view-frame coordinates); stops the trackball's throw (the camera doesn't keep turning after it). Returns 0, or -1 on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | viewer |
viewer handle (vkf_viewer_create) |
||
| real(kind=c_double), | intent(in), | dimension(3) | :: | eye |
view-frame coordinates |
|
| real(kind=c_double), | intent(in), | dimension(3) | :: | center |
view-frame coordinates |
|
| real(kind=c_double), | intent(in), | dimension(3) | :: | up |
view-frame coordinates |
A mouse event from the host's window. Returns 0, or -1 on failure (or an unknown kind).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | viewer |
viewer handle (vkf_viewer_create) |
||
| integer(kind=c_int), | value | :: | kind |
1 = move, 2 = button press, 3 = button release |
||
| integer(kind=c_int), | value | :: | x |
pointer position (framebuffer pixels from the left) |
||
| integer(kind=c_int), | value | :: | y |
pointer position (framebuffer pixels from the top) |
||
| integer(kind=c_int), | value | :: | mask |
the buttons held (VSG's BUTTON_MASK_1/2/3 = 256/512/1024) |
||
| integer(kind=c_int), | value | :: | button |
the button pressed or released (1 left, 2 middle, 3 right) |
Use an orthographic projection with the given view-volume bounds. Returns 0, or -1 on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | viewer |
viewer handle (vkf_viewer_create) |
||
| real(kind=c_double), | value | :: | left | |||
| real(kind=c_double), | value | :: | right | |||
| real(kind=c_double), | value | :: | bottom | |||
| real(kind=c_double), | value | :: | top | |||
| real(kind=c_double), | value | :: | near_distance | |||
| real(kind=c_double), | value | :: | far_distance |
Use a perspective projection. Returns 0, or -1 on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | viewer |
viewer handle (vkf_viewer_create) |
||
| real(kind=c_double), | value | :: | fovy |
vertical field of view (degrees) |
||
| real(kind=c_double), | value | :: | near_distance |
near and far plane distances (scene units) |
||
| real(kind=c_double), | value | :: | far_distance |
near and far plane distances (scene units) |
Framebuffer pixels per window unit (2 on Retina; a host's window's as given).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | viewer |
viewer handle (vkf_viewer_create) |
Frames recorded so far, or -1 if not recording or recording failed.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | viewer |
viewer handle (vkf_viewer_create) |
Start recording the frames drawn to a video of fps frames per second: piped as raw video to
ffmpeg (the program), encoded with output (ffmpeg's output options, then the file, quoted).
Returns 0, or -1 if already recording.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | viewer |
viewer handle (vkf_viewer_create) |
||
| character(kind=c_char, len=1), | intent(in), | dimension(*) | :: | ffmpeg |
the ffmpeg command (quoted if need be) |
|
| integer(kind=c_int), | value | :: | ffmpeg_len |
the length of |
||
| character(kind=c_char, len=1), | intent(in), | dimension(*) | :: | output |
ffmpeg's output options and file |
|
| integer(kind=c_int), | value | :: | output_len |
the length of |
||
| real(kind=c_double), | value | :: | fps |
frames per second of the video |
Stop recording: the last frames written and ffmpeg's input closed (it finishes the file). Returns the frames written, or -1 if not recording or on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | viewer |
viewer handle (vkf_viewer_create) |
Remove a node from the viewer's scene (its GPU data are released a few frames later). Returns 0, or -1 if it is not in the scene.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | viewer |
viewer handle (vkf_viewer_create) and node handle |
||
| type(c_ptr), | value | :: | node |
viewer handle (vkf_viewer_create) and node handle |
The host resized its window: rebuild the swapchain. A window of no width or height (e.g. a collapsed splitter) is not drawn until it has a size again. Returns 0, or -1 on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | viewer |
viewer handle (vkf_viewer_create) |
||
| integer(kind=c_int), | value | :: | width |
the new size (framebuffer pixels) |
||
| integer(kind=c_int), | value | :: | height |
the new size (framebuffer pixels) |
The size of the viewer's scene graph into counts: nodes, draw commands, vertices (traverses it all). Returns 0, or -1.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | viewer |
viewer handle (vkf_viewer_create) |
||
| real(kind=c_double), | intent(out) | :: | counts(3) |
A scroll wheel event from the host's window. Returns 0, or -1 on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | viewer |
viewer handle (vkf_viewer_create) |
||
| real(kind=c_float), | value | :: | dy |
the scroll amount: > 0 away from the user |
Set the background (clear) color. Returns 0, or -1 on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | viewer |
viewer handle (vkf_viewer_create) |
||
| real(kind=c_float), | intent(in), | dimension(4) | :: | rgba |
color (rgba, 0 to 1) |
The trackball's sensitivity: zoom_speed scales each scroll step's zoom and a right drag's;
throw (1) keeps the camera moving after a drag released while moving. Returns 0, or -1.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | viewer |
viewer handle (vkf_viewer_create) |
||
| real(kind=c_double), | value | :: | zoom_speed |
(> 0; 1: VSG's) |
||
| integer(kind=c_int), | value | :: | throw |
1: keep moving after a released drag |
Whether a left button press takes the mouse from the trackball (armed 1: a handle is under the cursor), until the button is released: those events are given with key 1 (vkf_viewer_events). Returns 0, or -1 on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | viewer |
viewer handle (vkf_viewer_create) |
||
| integer(kind=c_int), | value | :: | armed |
1: armed; 0: not |
A host's window now has ratio framebuffer pixels per window unit.
(Qt's devicePixelRatio changed: moved to a screen of another scale, or the display's scaling
changed.) Sizes in window units (line widths, markers, labels) are scaled by it; the host also
resizes (vkf_viewer_resize) to the new framebuffer size. Returns 0, or -1 on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | viewer |
viewer handle (vkf_viewer_create) |
||
| real(kind=c_double), | value | :: | ratio |
framebuffer pixels per window unit (> 0) |
Set the transform from world (scene root) to view-frame coordinates, applied after the trackball's eye/center/up (see ViewLookAt). Returns 0, or -1 on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | viewer |
viewer handle (vkf_viewer_create) |
||
| real(kind=c_double), | intent(in), | dimension(4,4) | :: | m |
world to view-frame matrix |
The swapchain's size (framebuffer pixels): a VSG window's size as it is resized (a host's window has the size it gives, vkf_viewer_resize). Returns 0, or -1 on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | viewer |
viewer handle (vkf_viewer_create) |
||
| integer(kind=c_int), | intent(out) | :: | width |
the size (framebuffer pixels) |
||
| integer(kind=c_int), | intent(out) | :: | height |
the size (framebuffer pixels) |
The viewer's last frame drawn, into stats(1:n) (n at most 9): frames drawn, milliseconds waiting for a swapchain image, recording and submitting, presenting, the GPU's time (-1: not measured), the framebuffer's width and height, the device memory in use and its budget (bytes; -1: unknown). Returns 0, or -1.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | viewer |
viewer handle (vkf_viewer_create) |
||
| real(kind=c_double), | intent(out) | :: | stats(*) | |||
| integer(kind=c_int), | value | :: | n |
the size of |
Name of the first Vulkan physical device, into buf; returns its length, or -1 on failure.
Needs no window, so it checks that the Vulkan loader finds a driver (MoltenVK on macOS).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(kind=c_char, len=1), | intent(out), | dimension(*) | :: | buf |
the name (not null-terminated) |
|
| integer(kind=c_int), | value | :: | buflen |
the length of |
Set a line's dash pattern, as OpenGL's line stipple: each bit of the
16-bit pattern (bit 0 first; z'FFFF' solid) covers factor window
units (see shaders/line.vert).
Returns 0, or -1 on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | intent(in) | :: | line |
line handle |
||
| integer, | intent(in) | :: | factor | |||
| integer, | intent(in) | :: | pattern |
Set the points of a line strip (xyz(3, n), double precision), splitting
each coordinate, and the distance along the strip, into the (high, low)
float pair the line shader reads, in place in the strip's buffer.
Returns 0, or -1 if n exceeds the capacity.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | intent(in) | :: | line |
line, marker or ribbon handle |
||
| real(kind=c_double), | intent(in), | dimension(:,:) | :: | xyz |
(3, n) points |
Draw a line's points as separate segments (pairs of points: 1-2, 3-4, ...) instead of a strip. Set before its points are drawn. Returns 0, or -1 on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | intent(in) | :: | line |
line handle |
||
| logical, | intent(in) | :: | segments |
true for separate segments, false for a strip |
Set the color (rgba) and width (window units: logical pixels) of a line strip.
Returns 0, or -1 on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | intent(in) | :: | line |
line or ribbon handle |
||
| real(kind=c_float), | intent(in), | dimension(4) | :: | rgba |
color (rgba, 0 to 1) |
|
| real(kind=c_float), | intent(in) | :: | width |
width (window units) |
Set the color (rgba), size (window units), shape (see shaders/
marker.frag) and attenuation radius (scene units; 0 for none) of markers.
Returns 0, or -1 on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | intent(in) | :: | marker |
marker handle (vkf_marker_create) |
||
| real(kind=c_float), | intent(in), | dimension(4) | :: | rgba |
color (rgba, 0 to 1) |
|
| real(kind=c_float), | intent(in) | :: | size | |||
| integer, | intent(in) | :: | shape | |||
| real(kind=c_float), | intent(in) | :: | radius |
Set a lit mesh's material: ambient, diffuse, specular and emissive colors (rgba) and shininess (VSG's Phong: the ambient color scales the diffuse color reflected from ambient light). Returns 0, or -1 on failure (e.g. a mesh without a material).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | intent(in) | :: | mesh |
mesh handle (vkf_mesh_create) |
||
| real(kind=c_float), | intent(in), | dimension(4) | :: | ambient |
colors (rgba, 0 to 1) |
|
| real(kind=c_float), | intent(in), | dimension(4) | :: | diffuse |
colors (rgba, 0 to 1) |
|
| real(kind=c_float), | intent(in), | dimension(4) | :: | specular |
colors (rgba, 0 to 1) |
|
| real(kind=c_float), | intent(in), | dimension(4) | :: | emissive |
colors (rgba, 0 to 1) |
|
| real(kind=c_float), | intent(in) | :: | shininess |
Phong exponent |
Name of the first Vulkan physical device, or an empty string if there is none.
Report a failed rendering-layer call (a status not 0), saying where
(context, e.g. 'shapes').
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=c_int), | intent(in) | :: | status |
a rendering-layer call's result (0: success) |
||
| character(len=*), | intent(in), | optional | :: | context |
where the call was made |
Pointers to the arrays of a mesh of n_vertices vertices and n_indices
indices (as created by vkf_mesh_create), to fill in place before the
first frame. Indices are 0-based.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | intent(in) | :: | mesh |
mesh handle (vkf_mesh_create) |
||
| integer, | intent(in) | :: | n_vertices | |||
| integer, | intent(in) | :: | n_indices | |||
| real(kind=c_float), | intent(out), | dimension(:,:), pointer | :: | xyz |
(3, n_vertices) |
|
| real(kind=c_float), | intent(out), | dimension(:,:), pointer | :: | normals |
(3, n_vertices) |
|
| real(kind=c_float), | intent(out), | dimension(:,:), pointer | :: | uv |
(2, n_vertices) |
|
| integer(kind=c_int32_t), | intent(out), | dimension(:), pointer | :: | indices |
(n_indices) triangle indices, 0-based |