arcan_api_overview(1)
๐ธ NAME ๐ธ
Okay so this is arcan_api_overview(1) โ the Developer API Reference for Arcan, and the vibe is Scripting Overview. Bestie, it's iconic. ๐
โจ SYNOPSIS โจ
Getting an application (short, appl) up and running in Arcan is lowkey barely any work. You just create a directory with a qualifying name matching ([a-Z]1[a-Z,0-9]* and put a similarly named my_applname.lua file inside. The following section list the entry points that the engine will look for, when appropriate โ replace xxx with the qualifying name of your appl. ๐ซถ
To speed things along, check the wiki on arcan-fe.com and work through the exercises corresponding to the ability level that you want to achieve. โจ
๐ Entry Points ๐
xxx()โ invoked as soon as audio/video/event/database subsystems are active. ๐xxx_clock_pulse()โ invoked every logical clock-pulse on a default monotonic clock at25Hzunlessclock_pulse_batchis set, then it takes precedence. TheCLOCKglobal provides the current global clock value. โฐxxx_clock_pulse_batch(nticks, count)โ alternate form to_clock_pulsethat handles congestion (> 1ticks) by providing them in one single go. ๐xxx_input(evtbl)โ invoked every time an input device emits a valid output sample; this varies with user activity and filter configuration.Evtblcontains a number of fields: ๐ฎ- when
kindistouch:devid,subid,pressure,size,x,y - when
kindisanalog:source,devid,subid,active,relative,samples - when
kindisdigitalandtranslated = true:number,keysym,modifiers,devid,subid,utf8,active,device,subdevice - when
kindisdigitalandtranslated = false:source,devid,subid,active - when
kindiseyes:blink_left,blink_right,gaze_x1,gaze_y1,gaze_x2,gaze_y2,present,head_x,head_y,head_z,head_rx,head_ry,head_rz
- when
xxx_input_end()โ signifies that the current input buffer is empty. This can be used as an input optimization trigger to accumulate input events before processing them forward. ๐งบxxx_input_raw()โ behaves like an advanced complement toxxx_input. By implementing it, the application signals that it can handle out of loop input events. This can reduce input latency in cases where events arrive while GPUs are locked for scanout. The contract is that if this function is present, you cannot call any part of the API that would modify GPU related state. The safe option is to restrict handling to patching and forwarding input to an external client. If the input was consumed, returntrue. Otherwise the input will be re-injected when the GPUs have been unlocked. ๐ฅxxx_adopt(vid, kind, title, parent, last)โ invoked as part ofsystem_collapse, script crash recovery fallback or on--pipe-stdin. Implies that there already exists a frameserver connection that can be adopted.Lastindicates whethere there are more to come, andparentif there's a subsegment-parent relation. Returntrueif the connection can be imported into the current script, otherwise it will be destroyed automatically. ๐ซถxxx_preframe_pulse()xxx_postframe_pulse()โ invoked right before and after synchronized transfer of a video frame; this may occur at rather spurious intervals depending on engine configuration and active synchronization strategy. Any computation in this entrypoint should be considered costly, and it is mainly provided for monitoring purpsoes. ๐xxx_adopt(vid, segid, title, parent, last)โ invoked when an application is set to collapse with transfers or when recovering from a scripting error. It is used to allow the new script to retrieve externally bound vids. Returntrueif the VID was adopted; otherwise it will be automatically deleted. ๐ฆxxx_display_state(action, id, state)โ invoked when there has been a change in the output display configuration state, typically in response to hotplug events. ๐ฅ๏ธxxx_fatal(msg)โ invoked on a scripting error that is fatal, as a final means of saving state and conveying a message. The returned string will be attached to crash dump output. ๐xxx_shutdown()โ triggered as a final state before the arcan process will exit. The most reasonable use for this entrypoint is terminating network connections with protocols that work better when clients are cooperating, but also for saving configuration through the database (e.g.store_key). ๐
๐ง resource ๐ง
resource(3), glob_resource(3), list_namespaces(3), zap_resource(3), open_nonblock(3), open_rawresource(3), close_rawresource(3), write_rawresource(3), read_rawresource(3), save_screenshot(3). ๐พ
๐ฏ targetcontrol ๐ฏ
launch_target(3), target_alloc(3), target_input(3), input_target(3), suspend_target(3), resume_target(3), message_target(3), accept_target(3), pacify_target(3), stepframe_target(3), snapshot_target(3), restore_target(3), bond_target(3), reset_target(3), focus_target(3), target_portconfig(3), target_framemode(3), target_verbose(3), target_synchronous(3), target_flags(3), target_graphmode(3), target_anchorhint(3), target_displayhint(3), target_devicehint(3), target_fonthint(3), target_geohint(3), target_seek(3), target_parent(3), target_coreopt(3), target_updatehandler(3), arcantarget_hint(3), define_rendertarget(3), define_linktarget(3), define_recordtarget(3), define_calctarget(3), define_feedtarget(3), define_nulltarget(3), define_arcantarget(3), rendertarget_forceupdate(3), rendertarget_vids(3), recordtarget_gain(3), rendertarget_detach(3), rendertarget_bind(3), rendertarget_attach(3), rendertarget_noclear(3), rendertarget_id(3), rendertarget_range(3), rendertarget_metrics(3), rendertarget_reconfigure(3), launch_decode(3), launch_avfeed(3). ๐
๐๏ธ database ๐๏ธ
store_key(3), get_key(3), get_keys(3), match_keys(3), list_targets(3), list_target_tags(3), target_configurations(3). ๐
๐ง audio ๐ง
play_audio(3), delete_audio(3), load_asample(3), audio_gain(3), audio_buffer_size(3), audio_position(3), audio_outputs(3), audio_listener(3), audio_reconfigure(3), capture_audio(3), list_audio_inputs(3). ๐ถ
๐ผ๏ธ image ๐ผ๏ธ
load_image(3),load_image_asynch(3),image_loaded(3),delete_image(3),show_image(3),hide_image(3),move_image(3),nudge_image(3),rotate_image(3),scale_image(3),resize_image(3),resample_image(3),blend_image(3),crop_image(3),persist_image(3),image_parent(3),center_image(3),image_children(3),order_image(3),max_current_image_order(3),link_image(3),relink_image(3),set_image_as_frame(3),image_framesetsize(3),image_framecyclemode(3),image_pushasynch(3),image_active_frame(3),image_origo_offset(3),image_inherit_order(3),image_tesselation(3)expire_image(3),reset_image_transform(3),instant_image_transform(3),tag_image_transform(3),image_transform_cycle(3),copy_image_transform(3),transfer_image_transform(3),copy_surface_properties(3),image_set_txcos(3),image_get_txcos(3),image_set_txcos_default(3),image_texfilter(3),image_scale_txcos(3),image_clip_on(3),image_clip_off(3),image_mask_toggle(3),image_mask_set(3),image_screen_coordinates(3),image_mask_clear(3),image_tracetag(3),image_mask_clearall(3)image_shader(3),image_state(3),image_access_storage(3),image_resize_storage(3),image_metadata(3),image_sharestorage(3),image_matchstorage(3),cursor_setstorage(3),cursor_position(3),move_cursor(3),nudge_cursor(3),resize_cursor(3),image_color(3),image_mipmap(3),fill_surface(3),alloc_surface(3),raw_surface(3),color_surface(3),null_surface(3),image_surface_properties(3),image_storage_properties(3),image_storage_slice(3),render_text(3),text_surface(3),text_dimensions(3),random_surface(3),force_image_blend(3),image_hit(3),pick_items(3),image_surface_initial_properties(3),image_surface_resolve_properties(3),image_surface_resolve(3),image_surface_initial(3)
๐ง 3d ๐ง
new_3dmodel(3), finalize_3dmodel(3), add_3dmesh(3), attrtag_model(3), move3d_model(3), rotate3d_model(3), orient3d_model(3), scale3d_model(3), forward3d_model(3), strafe3d_model(3), step3d_model(3), camtag_model(3), build_3dplane(3), build_3dbox(3), build_sphere(3), build_cylinder(3), build_pointcloud(3), scale_3dvertices(3), swizzle_model(3), mesh_shader(3). ๐ง
โ๏ธ system โ๏ธ
shutdown(3), warning(3), system_load(3), system_context_size(3), system_snapshot(3), system_collapse(3), subsystem_reset(3), utf8kind(3), decode_modifiers(3), benchmark_enable(3), benchmark_tracedata(3), benchmark_timestamp(3), benchmark_data(3), appl_arguments(3), system_identstr(3), system_defaultfont(3), frameserver_debugstall(3). ๐ ๏ธ
๐น๏ธ iodev ๐น๏ธ
kbd_repeat(3), toggle_mouse_grab(3), input_capabilities(3), input_samplebase(3), input_remap_translation(3), set_led(3), led_intensity(3), set_led_rgb(3), controller_leds(3), vr_setup(3), vr_map_limb(3), vr_metadata(3), inputanalog_filter(3), inputanalog_query(3), inputanalog_toggle(3). ๐ฎ
๐บ vidsys ๐บ
switch_default_scalemode(3), switch_default_texmode(3), switch_default_imageproc(3), switch_default_texfilter(3), switch_default_blendmode(3), set_context_attachment(3), resize_video_canvas(3), video_displaymodes(3), video_displaydescr(3), video_displaygamma(3), map_video_display(3), video_display_state(3), video_3dorder(3), build_shader(3), delete_shader(3), valid_vid(3), video_synchronization(3), shader_uniform(3), shader_ugroup(3), push_video_context(3), storepush_video_context(3), storepop_video_context(3), pop_video_context(3), current_context_usage(3). ๐ฅ๏ธ
๐ network ๐
net_open(3), net_discover(3), net_listen(3). ๐ก
๐ซ SEE-ALSO ๐ซ
arcan(1). ๐
๐ AUTHOR ๐
Bjorn Stahl <contact at arcan-fe dot com>. ๐
Okay bye bestie โ this page is from arcan, dated August 2014, and it's the arcan_api_overview(1) manual. Slay and stay iconic. ๐โจ
๐ฆ where this page comes from
- nixos 26.05: arcan 0.7.1
- nixpkgs unstable: arcan 0.7.1
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms