From 8db1b1db06f8f819704d946c0afb30b6d201e39e Mon Sep 17 00:00:00 2001 From: bjorn Date: Tue, 4 Oct 2016 15:01:29 -0700 Subject: [PATCH] Documentation; --- README.md | 66 +++--------------------------------------------- doc/COMPILING.md | 35 ++++++++++++------------- 2 files changed, 21 insertions(+), 80 deletions(-) diff --git a/README.md b/README.md index 514fd660..f5cbcb8b 100644 --- a/README.md +++ b/README.md @@ -23,12 +23,12 @@ function lovr.draw(eye) 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`. +Drag the `myGame` folder onto a shortcut to `lovr.exe`. You should see a spinning purple cube! Documentation --- -Some rough reference documentation exists in [API.md](doc/API.md). +Some basic reference documentation exists in [`API.md`](doc/API.md). Supported Hardware --- @@ -40,64 +40,4 @@ 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](https://github.com/bjornbytes/lovr-deps): - -```sh -cd lovr -git clone --recursive https://github.com/bjornbytes/lovr-deps deps -``` - -Next, build using the CMake GUI or using the CMake command line. - -```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`. - -### OSX (tup) - -Used for development, not generally recommended. - -One-time setup: - -```sh -cd lovr -git clone git@github.com:ValveSoftware/openvr .. -export DYLD_LIBRARY_PATH=`pwd`/../openvr/lib/osx32 -brew install assimp glfw3 luajit -``` - -Compiling: - -```sh -tup -``` - -Running a game: - -```sh -$ ./lovr /path/to/game -``` +See the [compilation guide](doc/COMPILING.md). diff --git a/doc/COMPILING.md b/doc/COMPILING.md index 776c4a75..a14f71a8 100644 --- a/doc/COMPILING.md +++ b/doc/COMPILING.md @@ -7,11 +7,12 @@ Dependencies --- - LuaJIT -- GLFW (3.2+) and OpenGL (3.2+) and GLEW -- assimp (`lovr.model` and `lovr.graphics.newModel`) -- OpenVR (`lovr.headset`) +- GLFW (3.2+) +- OpenGL (Unix) or GLEW (Windows) +- assimp (for `lovr.model` and `lovr.graphics.newModel`) +- OpenVR (for `lovr.headset`) -Windows (Using CMake) +Windows (CMake) --- First, install [lovr-deps](https://github.com/bjornbytes/lovr-deps): @@ -21,7 +22,7 @@ cd lovr git clone --recursive https://github.com/bjornbytes/lovr-deps deps ``` -Next, build using the CMake GUI or using the CMake command line. +Next, use CMake to generate the build files: ```sh mkdir build @@ -44,27 +45,27 @@ create and run a game from this point is: - Create a `main.lua` file in the folder and put your code in there. - Drag the `MySuperAwesomeGame` folder onto the shortcut to `lovr.exe`. -### OSX (tup) +Unix (CMake) +--- -Used for development, not generally recommended. - -One-time setup: +First, clone [OpenVR](https://github.com/ValveSoftware/openvr). +Next, install the other dependencies above using your package manager of choice: ```sh -cd lovr -git clone git@github.com:ValveSoftware/openvr .. -export DYLD_LIBRARY_PATH=`pwd`/../openvr/lib/osx32 -brew install assimp glfw3 luajit tup +brew install assimp glfw3 luajit ``` -Compiling: +Next, build using CMake: ```sh -tup +mkdir build +cd build +cmake .. -DOPENVR_DIR=/path/to/openvr +cmake --build . ``` -Running a game: +The `lovr` executable should exist in `lovr/build` now. You can run a game like this: ```sh -$ ./lovr /path/to/game +./lovr /path/to/myGame ```