Skip to content

Commit

Permalink
docs: updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
tomezpl committed Oct 12, 2024
1 parent b69f552 commit 0b81e40
Showing 1 changed file with 16 additions and 72 deletions.
88 changes: 16 additions & 72 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,88 +3,32 @@
### About
LepusEngine is a game engine developed in C++ and modern OpenGL (versions >= 3.3).

The renderer uses a programmable pipeline and as a result comes with a bundled set of GLSL shaders.

### Building
The engine now uses CMake (tested version 3.15.2). Download and install it if you don't have it already.

General use of CMake comes down to running `cmake configure` and `cmake generate` (please look up KitWare's documentation to learn more).

Currently the engine only builds on Windows during to its reliance on PhysX. On Windows, you can also use CMake-gui.

#### Dependencies
Download binaries for these libraries and place them in `<lepus_root>/build/deps`:

* GLFW (*build/deps/glfw-x.x.x.bin.WIN64*)
* The root directory of a 64-bit pre-compiled binary GLFW package for MSVC++ (folder name usually *glfw-x.x.x.bin.WIN64*).
* For example, *build/deps/glfw-x.x.x.bin.WIN64/lib-vc2015/* should contain your 64-bit *glfw3.lib* files
* GLFW32 (*build/deps/glfw-x.x.x.bin.WIN32*)
* The root directory of a 32-bit pre-compiled binary GLFW package for MSVC++ (folder name usually *glfw-x.x.x.bin.WIN32*).
* For example, *build/deps/glfw-x.x.x.bin.WIN32/lib-vc2015/* should contain your 32-bit *glfw3.lib* files
* GLEW (*build/deps/glew-x.x.x-win32*)
* The root directory of a GLEW package for Win32 (folder name usually *glew-x.x.x-win32/glew-x.x.x*).
* For example, *build/deps/glew-x.x.x-win32/glew-x.x.x/lib/* should contain the *glew.lib* files
* PHYSX (*build/deps/PhysX-x.x/physx/install/vcxxwin64*)
* The root directory of the *compiled binaries* for PhysX for 64-bit Visual C++ (folder name usually *PhysX-x.x/physx/install/vcxxwin64*).
* For example, *build/deps/PhysX-x.x/physx/install/vcxxwin64/PhysX/include/* should contain the *PxPhysXConfig.h* header file.
* You can find info regarding building PhysX SDK from source on [NVIDIA's official PhysX repository](https://github.com/NVIDIAGameWorks/PhysX).
* PHYSX32 (*build/deps/PhysX-x.x/physx/install/vcxxwin32*)
* The root directory of the *compiled binaries* for PhysX for 32-bit Visual C++ (folder name usually *PhysX-x.x/physx/install/vcxxwin32*).
* For example, *build/deps/PhysX-x.x/physx/install/vcxxwin32/PhysX/include/* should contain the *PxPhysXConfig.h* header file.
* You can find info regarding building PhysX SDK from source on [NVIDIA's official PhysX repository](https://github.com/NVIDIAGameWorks/PhysX).

### Usage
The __RenderEngine__ class (from the _LepusEngine_::_Lepus3D_ namespace) is responsible for drawing pretty much anything to your screen.

__RenderEngine__ also creates and updates a GL context and window.

An example app using the engine would look like this:

```c++
#include <L3D/RenderEngine.h>
The engine uses CMake (>= 3.26) to generate build files. [Download and install it](https://cmake.org/download/) if you don't have it already.

using namespace LepusEngine;
using namespace Lepus3D;
Dependencies for the project are resolved and installed using [vcpkg](https://vcpkg.io/). See [Dependencies](#dependencies) for more info.

int main()
{
Lepus3D::RenderEngine engine("LepusDemo", 800, 600);
General use of CMake comes down to running `cmake configure` and `cmake generate` (please look up [KitWare's documentation](https://cmake.org/documentation/) to learn more).

Lepus3D::Material testMat("Test material", "PerVertexUnlit");
Lepus3D::BoxMesh testMesh;
Some IDEs such as Visual Studio, Visual Studio Code, and CLion come with CMake support or offer "CMake Tools" extensions that allow you to generate the build files from your IDE.
On Windows, you can also use CMake-gui.

// Be sure to get your own images, these are not provided with the Git repository
Lepus3D::Texture2D firstTx("container.jpg"); // Loads from Solution/Content/
testMat.SetAttributeTex("_Texture1", firstTx);
The project is primarily built with Visual C++ 2022 during development and [GCC 11.4.0 on GitHub Actions](https://github.com/tomezpl/LepusEngine/actions),
and as such those are the "officially supported" compilers at this time.

Lepus3D::Transform transform;

sf::Clock timer;
#### Dependencies
This project uses [vcpkg](https://vcpkg.io/) to locate and install dependencies, such as code libraries, while keeping the need for platform-specific configuration down to a minimum (or none).

bool running = true;
while (running)
{
float timeSeconds = timer.getElapsedTime().asSeconds();
testMat.SetAttributeF("_Time", timeSeconds);
transform.SetRotation(Vector3(timeSeconds * 25.f, timeSeconds * 50.f, 0.f));
transform.SetScale(sin(timeSeconds));
engine.Update(); // Update window events etc.
engine.StartScene(); // Start drawing (clear buffers etc.)
engine.DrawMesh(testMesh, testMat, transform);
engine.EndScene(); // Finish drawing (display in window)
running = engine.Update();
}
engine.Shutdown();
return 0;
}
```
vcpkg integrates with CMake via a CMake toolchain file. Provided you have a `VCPKG_ROOT` environment variable pointing at your **bootstrapped vcpkg** path,
the CMakeLists script for LepusEngine should automatically pick up the toolchain file and install the dependencies as needed.
See [Microsoft's vcpkg documentation](https://learn.microsoft.com/en-gb/vcpkg/get_started/get-started?pivots=shell-powershell) for more details.

Check the header files to see how things work. [RenderEngine.h](https://github.com/tomezpl/LepusEngine/blob/master/Lepus3D/Source/RenderEngine.h) is usually a good place to start.
Additionally, some open-source cross-platform dependencies, such as gl3w and imgui are included in the `3rdparty` directory.
For imgui, you'll need to run `git submodule update` in order to fetch code from the imgui repository before building LepusEngine.

### Contributing
I myself am focused on creating the renderer. However, I plan on making this a full game engine, and any help would be appreciated.
### Usage
See the ["demo" example program](https://github.com/tomezpl/LepusEngine/tree/master/src/examples/demo) for an example of how to use the engine's API.

If you have any questions you can contact me at **[email protected]**. If there are any pull requests I'll try to merge them into **master** (assuming they work).

### Licensing
LepusEngine is licensed under the MIT license. This means you are free to use LepusEngine in any way you want, but you must include the copyright notice and the permission notice.
Expand Down

0 comments on commit 0b81e40

Please sign in to comment.