accept URL from cli for lovr/love

This commit is contained in:
Leon van Kammen 2026-06-12 11:46:14 +02:00
parent c2c326f5a5
commit 72baae1d37
136 changed files with 75 additions and 57 deletions

View file

@ -4,10 +4,13 @@ Download/run the binaries for your platform in the releases section.<br>
Developers can run it via [LÖVR](https://lovr.org) or [LÖVE2D](https://love2d.org) Developers can run it via [LÖVR](https://lovr.org) or [LÖVE2D](https://love2d.org)
``` ```
$ love src # if you have LÖVE2D installed (>v12) -- ./lovr xurfer https://snips.sh/f/_U5-XctEVE?r=1' -- cube, monkey, scene
$ lovr src # if you have LÖVR installed $ love xurfer <url> # if you have LÖVE2D installed (>v12)
$ lovr xurfer <url> # if you have LÖVR installed
``` ```
**Example**: lovr xurfer <a href="https://snips.sh/f/_U5-XctEVE?r=1">https://snips.sh/f/_U5-XctEVE?r=1</a>
## Multiplatform Multimodal XR Browser ## Multiplatform Multimodal XR Browser
The aim of this project is providing **one [XR Hypermedia browser](https://xrhf.isvery.ninja) codebase** which gracefully degrades to handheld/embedded/braille devices: The aim of this project is providing **one [XR Hypermedia browser](https://xrhf.isvery.ninja) codebase** which gracefully degrades to handheld/embedded/braille devices:
@ -28,9 +31,9 @@ The aim of this project is providing **one [XR Hypermedia browser](https://xrhf.
So you can strip/bloat however you want, or build one yourself: So you can strip/bloat however you want, or build one yourself:
``` ```
$ cp src/ext/skeleton src/ext/myextension $ cp xurfer/ext/skeleton xurfer/ext/myextension
$ sed 's|skeleton|myextension|g' src/ext/myextension/* $ sed 's|skeleton|myextension|g' xurfer/ext/myextension/*
$ ./lovr src $ ./lovr xurfer
[i] loading 'myextension' [i] loading 'myextension'
... ...
``` ```

6
api.md
View file

@ -2,10 +2,10 @@
<pre> <pre>
<a href="">api</a> <a href="">api</a>
<a href="src/lib/json.lua">api.parser.json</a> <a href="xurfer/lib/json.lua">api.parser.json</a>
<a href="#api-parser-xml">api.parser.xml</a> <a href="#api-parser-xml">api.parser.xml</a>
<a href="src/lib/url.lua">api.url</a> <a href="xurfer/lib/url.lua">api.url</a>
<a href="src/util.lua">api.util</a> <a href="xurfer/util.lua">api.util</a>
<a href="">api.protocol</a> <a href="">api.protocol</a>
<a href="#api-ext">api.ext.*</a> <a href="#api-ext">api.ext.*</a>
<a href="#api-ext-exec">api.ext.exec(fn, ,..)</a> <a href="#api-ext-exec">api.ext.exec(fn, ,..)</a>

View file

@ -1,45 +0,0 @@
local util = require("util")
local ecs = require("ecs")
api = {
parser = {
json = require("json"),
xml = require("xmlSimple"),
},
url = require("url"),
util = require("util"),
ecs = ecs,
world = ecs.world(),
protocol = {},
ext = { -- all extensions are loaded here from disk at runtime
exec = function(...) util.exec(api.ext,...) end -- util function to call func on each extension
}
}
local runtime
local runtimepath
if lovr ~= nil then runtime = { path = "lovr", api = lovr } end
if love ~= nil then runtime = { path = "love", api = love } end
api = util.merge( api, runtime.api )
require( runtime.path .. "/main")
util.loaddir( "ext", api, api.ext )
util.loaddir( "media", api, api.media )
ecs.init()
api.ext.exec('init')
-- GLB URLS
--local url='https://coderofsalvation.codeberg.page/xrfragment-haxe/example/assets/example.glb?bar=1&f=2#foo'
--local url = 'https://codeberg.org/coderofsalvation/xrfragment/raw/branch/main/assets/template/website/website.glb'
--local url = 'https://codeberg.org/coderofsalvation/xrfragment/raw/branch/main/assets/simple-a.glb'
--local url = 'https://xrforge.isvery.ninja/models/zzswz4qlqw8w/model_files/test.xrf.glb'
--
-- JANUS JML URLS
--local url = 'https://janusxr.org/index.html'
--local url = 'https://snips.sh/f/rHFLg-cewi?r=1' -- cube
local url = 'https://snips.sh/f/_U5-XctEVE?r=1' -- cube, monkey, scene
api.ecs.add( api.world, { URI = { url = url, method = 'GET', target = '_top' } })

View file

@ -1,12 +1,14 @@
local api = ... local api = ...
local sample = require "sample" local sample
return { return {
name = "kitchensink", name = "kitchensink",
enabled = false, enabled = (lover ~= nil),
init = function() end, init = function()
sample = require "sample"
end,
update = function() update = function()
local iui = api.iui local iui = api.iui

View file

Before

Width:  |  Height:  |  Size: 638 KiB

After

Width:  |  Height:  |  Size: 638 KiB

View file

Before

Width:  |  Height:  |  Size: 310 KiB

After

Width:  |  Height:  |  Size: 310 KiB

View file

Before

Width:  |  Height:  |  Size: 684 KiB

After

Width:  |  Height:  |  Size: 684 KiB

View file

Before

Width:  |  Height:  |  Size: 663 KiB

After

Width:  |  Height:  |  Size: 663 KiB

View file

Before

Width:  |  Height:  |  Size: 782 KiB

After

Width:  |  Height:  |  Size: 782 KiB

View file

Before

Width:  |  Height:  |  Size: 708 KiB

After

Width:  |  Height:  |  Size: 708 KiB

View file

@ -1,3 +1,9 @@
api.protocol.http = {
request = function(url,opts)
print("[!] todo: love2D/lua api.protocol.http needs curl/wget fallback")
end
}
-- Load some default values for our rectangle. -- Load some default values for our rectangle.
function love.load() function love.load()
x, y, w, h = 20, 20, 60, 20 x, y, w, h = 20, 20, 60, 20

View file

Before

Width:  |  Height:  |  Size: 175 KiB

After

Width:  |  Height:  |  Size: 175 KiB

View file

Before

Width:  |  Height:  |  Size: 599 B

After

Width:  |  Height:  |  Size: 599 B

View file

Before

Width:  |  Height:  |  Size: 232 B

After

Width:  |  Height:  |  Size: 232 B

View file

Before

Width:  |  Height:  |  Size: 405 B

After

Width:  |  Height:  |  Size: 405 B

View file

Before

Width:  |  Height:  |  Size: 628 B

After

Width:  |  Height:  |  Size: 628 B

View file

Before

Width:  |  Height:  |  Size: 617 B

After

Width:  |  Height:  |  Size: 617 B

View file

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View file

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Some files were not shown because too many files have changed in this diff Show more