|
||
---|---|---|
doc | ||
src | ||
.gitignore | ||
CMakeLists.txt | ||
README.md |
README.md
LÖVR
LÖVR lets you make VR games with Lua!
Example
In a folder called myGame
, create a file called main.lua
with this in it:
function lovr.update(dt)
t = (t or 0) + dt
end
function lovr.draw(eye)
local x, y, z = 0, .25, -2
local size = 1
local angle, rx, ry, rz = t * 2, 0, 1, 0
lovr.graphics.setColor(128, 0, 255)
lovr.graphics.cube('line', x, y, z, size, angle, rx, ry, rz)
end
Drag the myGame
folder onto a shortcut to lovr.exe
. You should see a spinning purple cube! See instructions below on compiling lovr.exe
.
Documentation
Some rough reference documentation exists in API.md.
Supported Hardware
- HTC Vive
Support for other hardware will happen eventually.
Compiling
Dependencies
- LuaJIT
- GLFW (3.2+) and OpenGL (3.2+)
- assimp
- SteamVR (OpenVR)
Windows (CMake)
- Install lovr-deps:
cd lovr
git clone --recursive https://github.com/bjornbytes/lovr-deps deps
Next, build using the CMake GUI or using the CMake command line.
mkdir build
cd build
cmake ..
This should output a Visual Studio solution, which can be built using Visual Studio. Or you can just build it with CMake:
cmake --build .
The executable will then exist at /path/to/lovr/build/Debug/lovr.exe
. The recommended way to create and run a game from this point is:
- Create a shortcut to the
lovr.exe
executable somewhere convenient. - Create a folder for your game:
MySuperAwesomeGame
. - Create a
main.lua
file in the folder and put your code in there. - Drag the
MySuperAwesomeGame
folder onto the shortcut tolovr.exe
.
OSX (tup)
Used for development, not generally recommended.
One-time setup:
cd lovr
git clone git@github.com:ValveSoftware/openvr ..
export DYLD_LIBRARY_PATH=`pwd`/../openvr/lib/osx32
brew install assimp glfw3 luajit
Compiling:
tup
Running a game:
$ ./lovr /path/to/game