/spearstake

A C++ game engine with OpenGL

Primary LanguageC++GNU General Public License v3.0GPL-3.0

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

  • 3D coordinate based block renderer (broken textures)
  • Chunk system
  • World generation
  • 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 and Block.hpp: Defines the Block class for rendering 3D blocks.
  • DDSLoader.cpp and DDSLoader.hpp: Defines a function to load textures from DDS files.
  • Position.cpp and Position.hpp: Defines the Position class for handling 3D positions of blocks, not cameras.
  • Shaders.cpp and Shaders.hpp: Contains a function to load shaders from files.
  • Window.cpp and Window.hpp: Defines the Window class for creating and managing the application window.
  • main.cpp: The entry point for the application.

Installation

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

Building the Project

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.

Running the Project

After building the project, you can run the application with the following command:

./build/spearstake

Running with Visual Studio Code

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.

License

This project is licensed under the terms of the GPL-3.0 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.