Code Monkey home page Code Monkey logo

trundle's Introduction

Language grade: C/C++

Trundle

This is a simple game engine built with c++17, created to learn about different aspects of games engines, because what better way to learn than by doing.

Dependancies

This project attempts to keep the dependancies down to a minimum and creating submodules whenever possible to automate dependancy building. Currently the only dependancies are:

  • CMake 3.17 or higher
  • A c++17 supported compiler (gcc >= 8.0, clang >= 5.0)
  • OpenGL
  • Python 2.7 or higher

Installing Dependancies

Go to cmake to download and install the latest version of CMake.

For the rest of the dependancies.

On Ubuntu:

# apt-get install -y libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libgl1-mesa-dev

Building

This project uses CMake as its build software, so simply need to run the following commands to build the project. Firstly clone the repository

$ git clone --recursive https://github.com/zacharyselk/Trundle.git

Then use CMake to compile the project

$ mkdir build && cd build
$ cmake ../Engine
$ cmake --build .

This will build the sample Driver in build/bin/ by default. To change the build location use $ cmake .. --DCMAKE_INSTALL_PREFIX=<path>

Running

Once built an exacutable named bin/driver (or bin\driver.exe) will be created and simply needs to be executed to run.

Builds

Service System Compiler Status
Travis CI MacOSX, Linux 64 bits Clang Build Status
AppVeyor Windows 32 and 64 Visual Studio 2019 Build status

trundle's People

Contributors

zacharyselk avatar

Stargazers

Hubert avatar Kyle McLean avatar  avatar  avatar

Watchers

James Cloos avatar  avatar  avatar

trundle's Issues

CMake files need to be rewritten

Need to completely rewrite:

  • CMakeLists.txt
  • Engine/CMakeLists.txt
  • Driver/CMakeLists.txt

These rewrites should only use modern CMake (CMake 3.0+) and proper flags/options.

Add colors to Log output

Each of the six log levels (Trace, Info, Debug, Warn, Error, and Critical) should print out with a unique color do differentiate what type of message it is.

OpenGL version checking tool needs to be created

A small command-line tool needs to be created in order to determine what version of OpenGL is currently installed and (in the future) to check what graphics APIs are available to the system. This tool needs to be able to be run by CMake during the build process so that the minimum required version can be checked at compile-time as well as so that compile-time flags can be set to enable appropriate function calls.

Visual Studio 2019 build error

When building with Visual Studio 2019 IDE the following errors are returned:

Error: \(default\)/GLFW/deps: No such file or directory
Error: \(default\)/GLFW/include: No such file or directory

Commit: 0467ce4
Build System: Ninja

Linking issues on Arch Linux

Issue

When compiling on an Arch Linux install that currently has glew installed on it, the linker runs into problems trying to link several glew functions as seen below

/usr/bin/ld: /home/zach/sync/code/Trundle/build/lib/libengine.so: undefined reference to `__glewGetUniformLocation'
/usr/bin/ld: /home/zach/sync/code/Trundle/build/lib/libengine.so: undefined reference to `__glewDetachShader'
/usr/bin/ld: /home/zach/sync/code/Trundle/build/lib/libengine.so: undefined reference to `__glewDeleteProgram'
/usr/bin/ld: /home/zach/sync/code/Trundle/build/lib/libengine.so: undefined reference to `__glewGetShaderiv'
/usr/bin/ld: /home/zach/sync/code/Trundle/build/lib/libengine.so: undefined reference to `__glewCompileShader'
/usr/bin/ld: /home/zach/sync/code/Trundle/build/lib/libengine.so: undefined reference to `__glewCreateProgram'
/usr/bin/ld: /home/zach/sync/code/Trundle/build/lib/libengine.so: undefined reference to `__glewBlendEquationSeparate'
/usr/bin/ld: /home/zach/sync/code/Trundle/build/lib/libengine.so: undefined reference to `__glewGenBuffers'
/usr/bin/ld: /home/zach/sync/code/Trundle/build/lib/libengine.so: undefined reference to `__glewShaderSource'
/usr/bin/ld: /home/zach/sync/code/Trundle/build/lib/libengine.so: undefined reference to `__glewCreateShader'
/usr/bin/ld: /home/zach/sync/code/Trundle/build/lib/libengine.so: undefined reference to `__glewGetProgramInfoLog'
/usr/bin/ld: /home/zach/sync/code/Trundle/build/lib/libengine.so: undefined reference to `__glewBindVertexArray'
/usr/bin/ld: /home/zach/sync/code/Trundle/build/lib/libengine.so: undefined reference to `__glewGetShaderInfoLog'
/usr/bin/ld: /home/zach/sync/code/Trundle/build/lib/libengine.so: undefined reference to `__glewUniformMatrix4fv'
/usr/bin/ld: /home/zach/sync/code/Trundle/build/lib/libengine.so: undefined reference to `__glewBindSampler'
/usr/bin/ld: /home/zach/sync/code/Trundle/build/lib/libengine.so: undefined reference to `__glewUniform1i'
/usr/bin/ld: /home/zach/sync/code/Trundle/build/lib/libengine.so: undefined reference to `__glewBlendEquation'
/usr/bin/ld: /home/zach/sync/code/Trundle/build/lib/libengine.so: undefined reference to `__glewBindBuffer'
/usr/bin/ld: /home/zach/sync/code/Trundle/build/lib/libengine.so: undefined reference to `__glewDeleteShader'
/usr/bin/ld: /home/zach/sync/code/Trundle/build/lib/libengine.so: undefined reference to `__glewVertexAttribPointer'
/usr/bin/ld: /home/zach/sync/code/Trundle/build/lib/libengine.so: undefined reference to `__glewGetAttribLocation'
/usr/bin/ld: /home/zach/sync/code/Trundle/build/lib/libengine.so: undefined reference to `__glewActiveTexture'
/usr/bin/ld: /home/zach/sync/code/Trundle/build/lib/libengine.so: undefined reference to `__glewBlendFuncSeparate'
/usr/bin/ld: /home/zach/sync/code/Trundle/build/lib/libengine.so: undefined reference to `__glewBufferData'
/usr/bin/ld: /home/zach/sync/code/Trundle/build/lib/libengine.so: undefined reference to `__glewDeleteBuffers'
/usr/bin/ld: /home/zach/sync/code/Trundle/build/lib/libengine.so: undefined reference to `__glewLinkProgram'
/usr/bin/ld: /home/zach/sync/code/Trundle/build/lib/libengine.so: undefined reference to `__glewDeleteVertexArrays'
/usr/bin/ld: /home/zach/sync/code/Trundle/build/lib/libengine.so: undefined reference to `__glewGenVertexArrays'
/usr/bin/ld: /home/zach/sync/code/Trundle/build/lib/libengine.so: undefined reference to `__glewUseProgram'
/usr/bin/ld: /home/zach/sync/code/Trundle/build/lib/libengine.so: undefined reference to `__glewDrawElementsBaseVertex'
/usr/bin/ld: /home/zach/sync/code/Trundle/build/lib/libengine.so: undefined reference to `__glewGetProgramiv'
/usr/bin/ld: /home/zach/sync/code/Trundle/build/lib/libengine.so: undefined reference to `__glewAttachShader'
/usr/bin/ld: /home/zach/sync/code/Trundle/build/lib/libengine.so: undefined reference to `__glewEnableVertexAttribArray'
collect2: error: ld returned 1 exit status

This is either an issue in Dear ImGui or an issue with how Trundle include the default backends backends/imgui_impl_glfw.h and backends/imgui_impl_opengl3.h inside of /Engine/src/Util/imGuiLayer.cpp insead of makeing its own.

Temporary Fix

A hotfix for this issue is to simply remove glew from the system. Assuming that it was installed using the package manager then to remove it simply run # pacman -Rcs glew and that should resolve the linking errors.

Add unit testing

Create a few basic unit tests and link them in to the build system

Header files not receiving proper include files

When #include <GL/gl3w.h> is added to a header file, it returns fatal error: 'GL/gl3w.h' file not found.
However if the same include is added to a source file there are no compilation errors.

LayerStack Memory Bug

In LayerStack an iterator it is currently maintained by hand, pointing to the separation point between normal layers and overlay layers. This iterator is pointing to a memory location in a std::vector but whenever the vector is dynamically resized the iterator does not get moved, causing it to point to a stale address and resulting in invalid reads and writes to memory.

Visual Studio build error

When building in the Visual Studio IDE, GLFW cannot be found. Returning the error: No such file or directory #include <GLFW/glfw3.h>. This makes building in the IDE not possible even though builds using the Visual Studio compiler does build correctly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.