lingdev
↓ 0 downloadsLingDev: a Godot / Unity-style game editor written in Ling. 2-D and 3-D scenes, Flash-style timeline and cutscenes, HUDs over 3-D, Ling scripting, audio / music / MIDI, builds for Windows, Linux, macOS, web, Raspberry Pi and LingOS. Ships with Ling Agent (an N64-style spy FPS), Ling Breaker (a 3-D breakout) and Moko's Picture Book (a kawaii storybook platformer).
Keywords game-engine, editor, 3d, 2d, cutscene, timeline, ling, lingos, raspberry-pi
lingfu install lingdevCode / Files (136)
ling/plat_os.ling
# plat_os.ling - the same plat_* surface for the LingOS kernel app runtime (Raspberry Pi / x86_64 LingOS).
# The kernel compiles .ling apps against px_* drawing, fonts, mouse / keyboard, the store and a
# read-only file table; there is no native 3-D, audio, model loading or networking yet, so those
# report "not available" and the editor / player fall back to the software renderer in rt_sw3d.
fn plat_name() { return "lingos" }
fn plat_has_3d() { return false }
fn plat_has_audio() { return false }
fn plat_has_models() { return false }
fn plat_has_images() { return true }
fn plat_has_net() { return false }
fn plat_has_ai() { return false }
fn plat_can_write() { return false }
fn plat_has_dialogs() { return false }
fn plat_has_midi() { return false }
fn plat_reveal(path) { return 0.0 }
fn plat_dlg_open(title, exts, start) { return "" }
fn plat_dlg_save(title, exts, name, start) { return "" }
fn plat_dlg_folder(title, start) { return "" }
fn plat_launch(path) { return 0.0 }
# images: the kernel draws a picture file by path, fitted into a rectangle (no handles)
fn plat_image_load(path) {
if !file_exists(path) { return 0.0 - 1.0 }
st_lpush("os_img", path)
return st_llen("os_img") - 1.0
}
fn plat_image_w(id) { return 0.0 }
fn plat_image_h(id) { return 0.0 }
fn plat_image_draw(id, x, y, w, h) {
if id < 0.0 || id >= st_llen("os_img") { return 0.0 }
px_image(st_lget("os_img", id), x, y, w, h)
return 0.0
}
fn plat_model_load(path) { return 0.0 - 1.0 }
fn plat_model_draw(h, x, y, z, scale, yaw) { return 0.0 }
fn plat_model_anim_count(h) { return 0.0 }
fn plat_model_anim_name(h, i) { return "" }
fn plat_model_anim_dur(h, i) { return 0.0 }
fn plat_model_tris(h) { return 0.0 }
fn plat_3d_begin(ambient) { return 0.0 }
fn plat_light(x, y, z, r, g, b, intensity, radius) { return 0.0 }
fn plat_color(c) { px_color(c) }
fn plat_shape(kind, cx, cy, cz, sx, sy, sz, rx, ry, rz, mode) { return 0.0 }
fn plat_3d_flush() { return 0.0 }
fn plat_post_now() { return 0.0 }
fn plat_fog(r, g, b, near, far) { return 0.0 }
fn plat_shade(mode, rim, c) { return 0.0 }
fn plat_mesh_hue(h, gain) { return 0.0 }
fn plat_blend(mode) { return 0.0 }
fn plat_sample_load(path) { return 0.0 - 1.0 }
fn plat_sample_play(id, x, y, z, w, vol, loop) { return 0.0 - 1.0 }
fn plat_sample_play_flat(id, vol, loop) { return 0.0 - 1.0 }
fn plat_sample_stop(v) { return 0.0 }
fn plat_sample_duration(id) { return 0.0 }
fn plat_listener(cy, sy, cp, sp) { return 0.0 }
fn plat_volume(v) { return 0.0 }
fn plat_sfx(x, y, z, w, freq, amp, dur, wave) { return 0.0 }
fn plat_music_load(path) { return 0.0 - 1.0 }
fn plat_music_play(id) { return 0.0 }
fn plat_music_stop() { return 0.0 }
fn plat_music_pause() { return 0.0 }
fn plat_music_seek(sec) { return 0.0 }
fn plat_music_pos() { return 0.0 }
fn plat_music_volume(v) { return 0.0 }
fn plat_music_duration(id) { return 0.0 }
fn plat_music_fft(id, n) { return [] }
fn plat_midi_load(path) { return 0.0 - 1.0 }
fn plat_midi_bars(id) { return [] }
fn plat_midi_count(id) { return 0.0 }
fn plat_patch_load(path) { return 0.0 - 1.0 }
fn plat_note(inst, midi, dur, vel) { return 0.0 }
fn plat_ui_sound(name) { return 0.0 }
fn plat_net_host(port) { return 0.0 }
fn plat_net_join(ip, port) { return 0.0 }
fn plat_net_send(s) { return 0.0 }
fn plat_net_recv() { return "" }
fn plat_net_status() { return 0.0 }
fn plat_net_events() { return "" }
fn plat_net_close() { return 0.0 }
fn plat_net_clients() { return 0.0 }
fn plat_bt_build(src) { return 0.0 - 1.0 }
fn plat_bt_set(h, k, v) { return 0.0 }
fn plat_bt_tick(h) { return "" }
fn plat_screenshot(name) { screenshot(name) }
fn plat_set_fps(f) { return 0.0 }
fn plat_close() { close_window() }
fn plat_args() { return get_args() }
fn plat_cwd() { return fs_cwd() }
fn plat_home() { return fs_home() }
fn plat_mkdir(p) { return false }
fn plat_copy(a, b) { return false }
fn plat_delete(p) { return false }
fn plat_list(p) { return fs_list(p) }
fn plat_is_dir(p) { return fs_is_dir(p) }
fn plat_write(path, text) { return false }
fn plat_read(path) {
if !file_exists(path) { return "" }
return read_file(path)
}
fn plat_text_fill(id, x, y, px, s) { px_text(id, x, y, px, st_get("pen", 16777215.0), s) }
fn plat_gamepad_poll() { return 0.0 }
fn plat_gamepad_connected() { return false }
fn plat_gamepad_lx() { return 0.0 }
fn plat_gamepad_ly() { return 0.0 }
fn plat_gamepad_button(b) { return false }
fn plat_gamepad_rx() { return 0.0 }
fn plat_gamepad_ry() { return 0.0 }
fn plat_gamepad_rt() { return 0.0 }
fn plat_capture_mouse() { return 0.0 }
fn plat_release_mouse() { return 0.0 }
# ── game 3-D extras: not available on the LingOS kernel build ────────────────
fn plat_has_g3d() { return false }
fn plat_sample_play_pitch(id, vol, pitch) { return 0.0 }
fn plat_post(depth, fxaa, ink, inkcol, bloom) { return 0.0 }
fn plat_frame_blur(a) { return 0.0 }
fn plat_tex_load(path, size) { return 0.0 - 1.0 }
fn plat_tm_load(path) { return 0.0 - 1.0 }
fn plat_tm_group(m, name) { return 0.0 - 1.0 }
fn plat_tm_bounds(m, g) { return [0.0, 0.0, 0.0, 0.0, 0.0, 0.0] }
fn plat_tm_draw(m, g, tex, x, y, z, s, rot, tint, a, uo, vo, us, vs, shade, blend, cull) { return 0.0 }
fn plat_tm_hole(x, y, z, r) { return 0.0 }
fn plat_tm_fov(deg, vw) { return 0.0 }
fn plat_tm_sprite(tex, cx, cy, w, h, rot, tint, a, blend) { return 0.0 }
fn plat_tm_billboard(tex, x, y, z, size, rot, tint, a, blend) { return 0.0 }
fn plat_coll_build(m, g, x, y, z, s, rot, cell) { return 0.0 - 1.0 }
fn plat_coll_sphere(id, x, y, z, r) { return [x, y, z, 0.0, 0.0, 0.0, 0.0, 0.0] }
fn plat_coll_ray(id, ox, oy, oz, dx, dy, dz, maxt) { return [0.0 - 1.0, 0.0, 0.0, 0.0] }
fn plat_pfx_emit(x, y, z, vx, vy, vz, life, s0, s1, c0, c1, kind, tex, grav, a) { return 0.0 }
fn plat_pfx_burst(x, y, z, n, speed, life, s0, s1, c0, c1, kind, grav, vx, vy, vz) { return 0.0 }
fn plat_pfx_rain(x0, z0, x1, z1, y, n, vy, life, s0, s1, tex0, ntex, a, col, yspread) { return 0.0 }
fn plat_pfx_step(dt, g, drag, floor, bounce) { return 0.0 }
fn plat_pfx_draw() { return 0.0 }
fn plat_pfx_clear() { return 0.0 }
fn plat_pfx_count() { return 0.0 }
fn plat_pfx_max(n) { return 0.0 }
fn plat_depth(on) { return 0.0 }
fn plat_tm_edges(m, g, mx) { return [] }
fn plat_voice(v, vol, pitch) { return 0.0 }
fn plat_font_load(path) { return 0.0 - 1.0 }
fn plat_text3d(f, x, y, z, ux, uy, uz, vx, vy, vz, size, s) { return 0.0 }
fn plat_tm_draw_lit(m, g, tex, x, y, z, s, rot, tint, a, uo, vo, us, vs, shade, blend, cull, amb) { return 0.0 }
fn plat_tm_wall_spots(m, g, spacing, up) { return [] }
fn plat_outline_threshold(t) { return 0.0 }
fn plat_sphere_lod(cx, cy, cz, sx, sy, sz, seg, rings) { return plat_shape("sphere", cx, cy, cz, sx, sy, sz, 0.0, 0.0, 0.0, 0.0) }