https://github.com/cpluspatch/spearstake
A C++ game engine with OpenGL
https://github.com/cpluspatch/spearstake
Last synced: 2 months ago
JSON representation
A C++ game engine with OpenGL
- Host: GitHub
- URL: https://github.com/cpluspatch/spearstake
- Owner: CPlusPatch
- License: gpl-3.0
- Created: 2023-12-14T18:18:47.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-15T18:57:10.000Z (over 2 years ago)
- Last Synced: 2025-12-26T23:24:35.985Z (6 months ago)
- Language: C++
- Size: 78.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Spearstake
This project is a 3D rendering application built with OpenGL, GLFW, and ImGui. It includes a block rendering system and texture loading from DDS files.
## Goals and Features
Spearstake is a small demo project I created to learn more about OpenGL and 3D rendering. It is supposed to be a voxel sandbox similar to Minecraft, with very large 3D world generation and rendering.
The project is currently in a very early stage of development, and only includes a block rendering system and texture loading from DDS files. Contributions are welcome!
### Features
- [x] 3D coordinate based block renderer (broken textures)
- [ ] Chunk system
- [ ] World generation
- [x] Player movement (as a camera)
## Project Structure
- `src/`: Contains the source files for the project.
- `src/shaders/`: Contains the vertex and fragment shader files.
- `textures/`: Contains the DDS texture files.
- `modules/`: Contains the ImGui library files, as well as other future Git submodules.
- `build/`: Contains the build files generated by CMake.
## Source Files
- [`Block.cpp`](src/Block.cpp) and `Block.hpp`: Defines the `Block` class for rendering 3D blocks.
- [`DDSLoader.cpp`](src/DDSLoader.cpp) and `DDSLoader.hpp`: Defines a function to load textures from DDS files.
- [`Position.cpp`](src/Position.cpp) and `Position.hpp`: Defines the `Position` class for handling 3D positions of blocks, not cameras.
- [`Shaders.cpp`](src/Shaders.cpp) and `Shaders.hpp`: Contains a function to load shaders from files.
- [`Window.cpp`](src/Window.cpp) and `Window.hpp`: Defines the `Window` class for creating and managing the application window.
- [`main.cpp`](src/main.cpp): The entry point for the application.
## Installation
This project's dependencies can be installed with this command in Arch Linux:
```sh
sudo pacman -S glfw-wayland glew glm glu cmake make
```
For other Linux distributions, you can install the dependencies with the following commands:
Ubuntu:
```sh
sudo apt install libglfw3-dev libglew-dev libglm-dev libglu1-mesa-dev cmake make
```
Fedora:
```sh
sudo dnf install glfw-devel glew-devel glm-devel mesa-libGLU-devel cmake make
```
Once the dependencies are installed, you can clone the repository with the following command (including submodules):
```sh
git clone https://github.com/CPlusPatch/spearstake.git --recurse-submodules
```
## Building the Project
This project uses CMake for building. To build the project, navigate to the project root directory and run the following commands:
```sh
mkdir build
cmake .
make
```
This will generate an executable in the [`build`](build) directory.
## Running the Project
After building the project, you can run the application with the following command:
```sh
./build/spearstake
```
## Running with Visual Studio Code
This project includes a [Visual Studio Code](https://code.visualstudio.com/) configuration file for building and running the project. To use this configuration, you must have the [C/C++ extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools) installed.
To build and run the project, you can run the `(gdb) Launch` configuration in the Debug tab, or simply press F5.
## License
This project is licensed under the terms of the [`GPL-3.0`](LICENSE) license.
## Contributing
Contributions are welcome. Please submit a pull request or create an issue to discuss the changes.
## Contact
For any questions or concerns, please open an issue on the project repository.