{"id":31790741,"url":"https://github.com/k-c-dacosta/fluffl","last_synced_at":"2025-10-10T16:29:19.578Z","repository":{"id":37920622,"uuid":"288059753","full_name":"K-C-DaCosta/fluffl","owner":"K-C-DaCosta","description":"A generic media layer for graphics, IO, and audio for desktop and the browser ","archived":false,"fork":false,"pushed_at":"2024-07-05T20:47:40.000Z","size":21964,"stargazers_count":18,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-10T16:29:19.213Z","etag":null,"topics":["audio","desktop","graphics","gui","mixing-audio","networking","rust","wasm","websockets-client"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/K-C-DaCosta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-08-17T01:53:09.000Z","updated_at":"2024-11-04T12:23:46.000Z","dependencies_parsed_at":"2024-07-05T22:54:19.038Z","dependency_job_id":null,"html_url":"https://github.com/K-C-DaCosta/fluffl","commit_stats":{"total_commits":163,"total_committers":1,"mean_commits":163.0,"dds":0.0,"last_synced_commit":"6b6e26bf6a86bea6e542466640b1fd01697e2dbe"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/K-C-DaCosta/fluffl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/K-C-DaCosta%2Ffluffl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/K-C-DaCosta%2Ffluffl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/K-C-DaCosta%2Ffluffl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/K-C-DaCosta%2Ffluffl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/K-C-DaCosta","download_url":"https://codeload.github.com/K-C-DaCosta/fluffl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/K-C-DaCosta%2Ffluffl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279004705,"owners_count":26083750,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["audio","desktop","graphics","gui","mixing-audio","networking","rust","wasm","websockets-client"],"created_at":"2025-10-10T16:29:16.869Z","updated_at":"2025-10-10T16:29:19.572Z","avatar_url":"https://github.com/K-C-DaCosta.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fluffl\n[![Build status](https://github.com/K-C-DaCosta/fluffl/actions/workflows/rust.yml/badge.svg?branch=master)](https://github.com/K-C-DaCosta/fluffl/actions/workflows/rust.yml)\n[![Crates.io](https://img.shields.io/crates/v/fluffl)](https://crates.io/crates/fluffl)\n[![Documentation](https://docs.rs/fluffl/badge.svg)](https://docs.rs/fluffl)\n\n\n# what is fluffl?\nfluffl is a media layer that provides an extremely simple, but cross-platform, interface between **desktop** and **wasm** targets.\nIts built on top of the \u003ca href=\"https://github.com/grovesNL/glow\"\u003eglow\u003c/a\u003e OpenGL bindings.\n\n## why fluffl? \nIf you need a *simple* layer/interface that provides audio,graphics, and maybe networking then this is the crate for you. \nInterface-wise its like SDL(you can use literally use* SDL if you select it) but it *doesn't* depend on the `wasm32-unknown-emscripten` target. The emscripten target is considered to be **deprecated** and is intended on being phased out last I checked. Instead, this crate uses the preferred `wasm32-unkown-unknown` target when building for the browser. \n\n## a simple example\nCheck the `examples` folder for runnable demos.\nWasm version of the examples are here: https://k-c-dacosta.github.io/wasm_bins/examples/audio_ex_1/\n\n## A breakout clone (more complicated)\nhttps://k-c-dacosta.github.io/wasm_bins/examples/brick_demo/\n\n## It comes with basic GUI infastructure(which I wrote) for simple UIs\nI wrote this GUI lib in pure rust so It will obviously work exactly the same when compiled for webassembly.\n\nhttps://user-images.githubusercontent.com/8314209/208758387-8c5b82da-48a1-427f-b1e5-b7a78f7d05d4.mp4\n\n### About the GUI module\nThe utility maintains a 2D scene graph (using a \"flat\" tree datastructure) of components. \n\nThe user is responsible for: \n- building the tree and defining the parent child relationships between components. \n- The user must then manually \"pipe\" events recieved from fluffl into the GUI Arena for everything to work.\n- The user of this utility must also define event listeners on the components he makes with this library.\n- Upon rendering of the GUI the user is currently responsible for restoring OpenGL state.\n    - Currently the GUI renderer traverses the scene graph in **preorder** traversal and draws each gui-component one at a time (not ideal)\n    - The draw routine makes heavy use of the stancil buffer, if for some reason that buffer isn't created this module wont work properly\n\nThe library has 3 built-in \"widgets\"/\"components\" so far:\n- A button\n- A slider\n- A textbox for user input \n\nThis GUI system was obviously not implemented with OOP principals, rather, I just used composition. I wrote this utility because I didn't want to hardcode my GUIs for any future applications that I might write with this. \n\n## Supported Backends\n- For the web it uses `WEBGL` and `WEBAUDIO`\n- For desktop:\n    - if `SDL2` is selected for windowing \n        - Audio options are:\n            - `SDL2` but with AUDIO_SUBSYTEM enabled\n    - if `GLUTIN` is slected for windowing\n        - Audio options are:\n            - `ALSA` - on linux \n            - `WASAPI` - on windows \n\nFor desktop targets `GLUTIN` (for windowing) and native audio APIS **are chosen by default** since it doesn't require the program to link to `SDL2` dynamic libraries since `SDL2` may not be installed on a lot of machines we can avoid a link error on compile. `GLUTIN` also appears to use either use native libraries or directly interacts with operating-system specific windowing protocols (major protocols are X windowing protocol and Wayland on linux)  \n\n## Using SDL2\nIf you *STILL* want to use SDL2 make sure its actually Installed\n\n### Installing SDL2 On ubuntu\nJust use apt to install:\n```\nsudo apt install libsdl2-dev\n```\n\n### Installing SDL2 On windows\n\nIts slightly more complicated. IIRC, you have to either drag the sdl2.dll (you either download it off the offical website or compile it yourself) file to a special directory where the compiler sits or place it in the directory where the binary is. My directions are currently vague because my main OS is linux and I'd have to reconfig my KVM instance of windows to figure out exactly what to do again. Luckily you can just cross-compile. \n\n## Cross Compiling to windows on Linux (doesn't matter if you select SDL2 or not)\n\nUsing MinGW you can actually build for windows on linux.\n\nOn ubuntu first install mingw :\n```\nsudo apt install mingw-w64\n```\n\nThen use rustup to install the mingw toolchain\n```\nrustup target add x86_64-pc-windows-gnu\n```\nFinally to compile you program do:\n\n```\ncargo build --target=x86_64-pc-windows-gnu\n```\nThe beauty of cross compilation is you can immediatly test the windows binary on your linux machine by running binary in `WINE` and it *just werks* (TM) . \n\nWine chads... **I kneel**\n\n## How to run examples\n- look in `./fluffl/examples` \n- pick a file you want to run (lets say we want to run brick_demo)\n- In the terminal do:\n\n```\ncargo run --exmaple=brick_demo\n``` \n\n## Cargo-Make\n\nI have scripts that basically does what the git-workflow does except locally, however it requires a tool called `cargo-make`.\n\nto use the script make sure `cargo-make` is installed by doing a:\n\n```\ncargo install cargo-make\n```\n\nthen to run do \n```\ncargo make build\n```\n\n## Update/Thoughts so far \n- I'm considering removing:\n    - websocket module (tungstenite)\n    - the Vorbis decoder (lewton) \n    - the mp3 decoder (puremp3)\n\nThis crate has over 20k lines. I have a hand-coded **GUI** ,**AudioMixer**, **linear-algebra** and **fixed-pont** libs built into the library that I'm considering splitting off into other crates.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk-c-dacosta%2Ffluffl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fk-c-dacosta%2Ffluffl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk-c-dacosta%2Ffluffl/lists"}