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.
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!
- 3D coordinate based block renderer (broken textures)
- Chunk system
- World generation
- Player movement (as a camera)
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.
Block.cpp
andBlock.hpp
: Defines theBlock
class for rendering 3D blocks.DDSLoader.cpp
andDDSLoader.hpp
: Defines a function to load textures from DDS files.Position.cpp
andPosition.hpp
: Defines thePosition
class for handling 3D positions of blocks, not cameras.Shaders.cpp
andShaders.hpp
: Contains a function to load shaders from files.Window.cpp
andWindow.hpp
: Defines theWindow
class for creating and managing the application window.main.cpp
: The entry point for the application.
This project's dependencies can be installed with this command in Arch Linux:
sudo pacman -S glfw-wayland glew glm glu cmake make
For other Linux distributions, you can install the dependencies with the following commands:
Ubuntu:
sudo apt install libglfw3-dev libglew-dev libglm-dev libglu1-mesa-dev cmake make
Fedora:
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):
git clone https://github.com/CPlusPatch/spearstake.git --recurse-submodules
This project uses CMake for building. To build the project, navigate to the project root directory and run the following commands:
mkdir build
cmake .
make
This will generate an executable in the build
directory.
After building the project, you can run the application with the following command:
./build/spearstake
This project includes a Visual Studio Code configuration file for building and running the project. To use this configuration, you must have the C/C++ extension installed.
To build and run the project, you can run the (gdb) Launch
configuration in the Debug tab, or simply press F5.
This project is licensed under the terms of the GPL-3.0
license.
Contributions are welcome. Please submit a pull request or create an issue to discuss the changes.
For any questions or concerns, please open an issue on the project repository.