mirror of https://github.com/bjornbytes/lovr.git
Update README;
This commit is contained in:
parent
e9605dfcf3
commit
2dfa792bd3
|
@ -0,0 +1,113 @@
|
||||||
|
Compiling LÖVR
|
||||||
|
===
|
||||||
|
|
||||||
|
You might want to compile LÖVR from source so you can use LÖVR on other operating systems or create
|
||||||
|
a custom build. Below is a guide for setting up all the dependencies
|
||||||
|
|
||||||
|
Dependencies
|
||||||
|
---
|
||||||
|
|
||||||
|
- LuaJIT
|
||||||
|
- GLFW (3.2+)
|
||||||
|
- OpenGL (3+)
|
||||||
|
- assimp
|
||||||
|
- OpenVR (1.0.5, for `lovr.headset`)
|
||||||
|
- PhysicsFS
|
||||||
|
- OpenAL (1.17+ recommended for HRTF support)
|
||||||
|
- FreeType
|
||||||
|
- Emscripten (optional, for compiling for web)
|
||||||
|
|
||||||
|
See [lovr-deps](https://github.com/bjornbytes/lovr-deps) for a GitHub repo containing all of these
|
||||||
|
as submodules.
|
||||||
|
|
||||||
|
Windows (CMake)
|
||||||
|
---
|
||||||
|
|
||||||
|
First, install [lovr-deps](https://github.com/bjornbytes/lovr-deps):
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cd lovr
|
||||||
|
git clone --recursive https://github.com/bjornbytes/lovr-deps deps
|
||||||
|
```
|
||||||
|
|
||||||
|
Next, use CMake to generate the build files:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
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:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
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 to `lovr.exe`.
|
||||||
|
|
||||||
|
Unix (CMake)
|
||||||
|
---
|
||||||
|
|
||||||
|
First, clone [OpenVR](https://github.com/ValveSoftware/openvr). For this example, we'll clone
|
||||||
|
`openvr` into the same directory that `lovr` was cloned into.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
git clone --branch v1.0.5 https://github.com/ValveSoftware/openvr.git
|
||||||
|
```
|
||||||
|
|
||||||
|
Next, install the other dependencies above using your package manager of choice:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
brew install assimp glfw3 luajit physfs freetype openal-soft
|
||||||
|
```
|
||||||
|
|
||||||
|
On OSX, you'll need to set the `DYLD_LIBRARY_PATH` environment variable to be
|
||||||
|
`/path/to/openvr/lib/osx32`.
|
||||||
|
|
||||||
|
Next, build using CMake:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
cmake .. -DOPENVR_DIR=../../openvr
|
||||||
|
cmake --build .
|
||||||
|
```
|
||||||
|
|
||||||
|
The `lovr` executable should exist in `lovr/build` now. You can run a game like this:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
./lovr /path/to/myGame
|
||||||
|
```
|
||||||
|
|
||||||
|
You can also copy or symlink LÖVR into a directory on your `PATH` environment variable (e.g.
|
||||||
|
`/usr/local/bin`) and run games from anywhere by just typing `lovr`.
|
||||||
|
|
||||||
|
WebVR
|
||||||
|
---
|
||||||
|
|
||||||
|
First, install the Emscripten SDK. Make sure you're running [this
|
||||||
|
branch](https://github.com/bjornbytes/emscripten/tree/lovr) of Emscripten.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
emcmake cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||||
|
emmake make -j2
|
||||||
|
```
|
||||||
|
|
||||||
|
The above commands will output `lovr.html`, `lovr.js`, and `lovr.js.mem`. To package a game, run:
|
||||||
|
|
||||||
|
```
|
||||||
|
python /path/to/emscripten/tools/file_packager.py game.data --preload /path/to/game@/ --js-output=game.js
|
||||||
|
```
|
||||||
|
|
||||||
|
Which will output `game.js` and `game.data`. The `lovr.html` file will need to be modified to
|
||||||
|
include `game.js` in a script tag.
|
119
README.md
119
README.md
|
@ -8,10 +8,10 @@ Features
|
||||||
---
|
---
|
||||||
|
|
||||||
- Automatically detects and renders to connected VR headsets (works without a headset too!)
|
- Automatically detects and renders to connected VR headsets (works without a headset too!)
|
||||||
- Simple graphics API supporting 3D primitives, 3D models, fonts, shaders, and skyboxes.
|
- Simple 3D graphics API supporting primitives, 3D models, fonts, shaders, and skyboxes.
|
||||||
- Export projects to standalone executables, or export to the web using WebVR.
|
- Export projects to standalone executables, or export to the web using WebVR.
|
||||||
- Spatialized audio for more immersive experiences.
|
- Spatialized audio
|
||||||
- 3D physics system
|
- 3D physics
|
||||||
|
|
||||||
Getting Started
|
Getting Started
|
||||||
---
|
---
|
||||||
|
@ -26,8 +26,9 @@ function lovr.draw()
|
||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
|
||||||
Put that code in a file called `main.lua`, and drop the `main.lua` folder onto `lovr.exe`. Put
|
To run it, first create a folder for your project and put the code in a file called `main.lua`.
|
||||||
on your headset and you should see the text at the front of your play area!
|
Then, just drop the `project` folder onto `lovr.exe` (or run `lovr.exe path/to/project` on the
|
||||||
|
command line). Put on your headset and you should see the text at the front of your play area!
|
||||||
|
|
||||||
#### Spinning Cube
|
#### Spinning Cube
|
||||||
|
|
||||||
|
@ -69,112 +70,8 @@ and can be found [here](https://github.com/bjornbytes/lovr-docs).
|
||||||
Compiling
|
Compiling
|
||||||
---
|
---
|
||||||
|
|
||||||
You might want to compile LÖVR from source so you can use LÖVR on other operating systems or create
|
To compile from source to create a custom build or contribute to LÖVR, see
|
||||||
a custom build.
|
[`COMPILING.md`](COMPILING.md).
|
||||||
|
|
||||||
### Dependencies
|
|
||||||
|
|
||||||
- LuaJIT
|
|
||||||
- GLFW (3.2+)
|
|
||||||
- OpenGL (3+)
|
|
||||||
- assimp
|
|
||||||
- OpenVR (1.0.5, for `lovr.headset`)
|
|
||||||
- PhysicsFS
|
|
||||||
- OpenAL (1.17+ recommended for HRTF support)
|
|
||||||
- FreeType
|
|
||||||
- Emscripten (optional, for compiling for web)
|
|
||||||
|
|
||||||
See [lovr-deps](https://github.com/bjornbytes/lovr-deps) for a GitHub repo containing all of these
|
|
||||||
as submodules.
|
|
||||||
|
|
||||||
#### Windows (CMake)
|
|
||||||
|
|
||||||
First, install [lovr-deps](https://github.com/bjornbytes/lovr-deps):
|
|
||||||
|
|
||||||
```sh
|
|
||||||
cd lovr
|
|
||||||
git clone --recursive https://github.com/bjornbytes/lovr-deps deps
|
|
||||||
```
|
|
||||||
|
|
||||||
Next, use CMake to generate the build files:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
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:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
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 to `lovr.exe`.
|
|
||||||
|
|
||||||
#### Unix (CMake)
|
|
||||||
|
|
||||||
First, clone [OpenVR](https://github.com/ValveSoftware/openvr). For this example, we'll clone
|
|
||||||
`openvr` into the same directory that `lovr` was cloned into.
|
|
||||||
|
|
||||||
```sh
|
|
||||||
git clone --branch v1.0.5 https://github.com/ValveSoftware/openvr.git
|
|
||||||
```
|
|
||||||
|
|
||||||
Next, install the other dependencies above using your package manager of choice:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
brew install assimp glfw3 luajit physfs freetype openal-soft
|
|
||||||
```
|
|
||||||
|
|
||||||
On OSX, you'll need to set the `DYLD_LIBRARY_PATH` environment variable to be
|
|
||||||
`/path/to/openvr/lib/osx32`.
|
|
||||||
|
|
||||||
Next, build using CMake:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
mkdir build
|
|
||||||
cd build
|
|
||||||
cmake .. -DOPENVR_DIR=../../openvr
|
|
||||||
cmake --build .
|
|
||||||
```
|
|
||||||
|
|
||||||
The `lovr` executable should exist in `lovr/build` now. You can run a game like this:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
./lovr /path/to/myGame
|
|
||||||
```
|
|
||||||
|
|
||||||
You can also copy or symlink LÖVR into a directory on your `PATH` environment variable (e.g.
|
|
||||||
`/usr/local/bin`) and run games from anywhere by just typing `lovr`.
|
|
||||||
|
|
||||||
#### WebVR
|
|
||||||
|
|
||||||
First, install the Emscripten SDK. Make sure you're running [this
|
|
||||||
branch](https://github.com/bjornbytes/emscripten/tree/lovr) of Emscripten.
|
|
||||||
|
|
||||||
```sh
|
|
||||||
mkdir build
|
|
||||||
cd build
|
|
||||||
emcmake cmake -DCMAKE_BUILD_TYPE=Release ..
|
|
||||||
emmake make -j2
|
|
||||||
```
|
|
||||||
|
|
||||||
The above commands will output `lovr.html`, `lovr.js`, and `lovr.js.mem`. To package a game, run:
|
|
||||||
|
|
||||||
```
|
|
||||||
python /path/to/emscripten/tools/file_packager.py game.data --preload /path/to/game@/ --js-output=game.js
|
|
||||||
```
|
|
||||||
|
|
||||||
Which will output `game.js` and `game.data`. The `lovr.html` file will need to be modified to
|
|
||||||
include `game.js` in a script tag.
|
|
||||||
|
|
||||||
License
|
License
|
||||||
---
|
---
|
||||||
|
|
Loading…
Reference in New Issue