Class, method, function, and other such entities are named with pascal case.
Variable names are named with camel case.
Curly braces on a new line.
private before protected before public; match order in source files.
Tabs for spaces, except when matching indentation.
void Foo(u64 arg)
{
Bar(arg,
true,
nullptr);
}Use define blocks instead of #pragma once for header guards.
#ifndef HEADER_NAME_H_
#define HEADER_NAME_H_
// Header file contents
#endifUse constructor initializater lists.
MyClass::MyClass(u64 arg) :
memberVariable(arg)
{
// Possibly do something here
}Use const and inline where applicable.
inline u64 GetVar() const { return memberVariable; }Limit includes as much as possible.
Use the fixed-size numeric types defined in types.h.
Do not perform raw IO outside of specifically designated engine subsystems.
We will be maintaining a Linux build, with full intention of this engine supporting cross-platform development. Don't break this with platform-specific code.
When including glm in a file, ensure that you #define GLM_ENABLE_EXPERIMENTAL before the GLM includes. The basic 3D maths GLM include section would look like :
#define GLM_ENABLE_EXPERIMENTAL
#include "../glm/glm.hpp"
#include "../glm/gtx/quaternion.hpp"The OpenGL Extension Wrangler Library is useful for determining the level of OpenGL functionality that the target platform supports. The following guide will help enable it in your environment:
-
Download GLEW at : https://sourceforge.net/projects/glew/files/glew/2.1.0/glew-2.1.0-win32.zip/download
-
After extracting all files, move the
GLfolder located inglew-2.1.0\includeto your project'sincludedirectory -
Copy the library files in
glew-2.1.0\lib\Release\x64to your project'slibrariesdirectory -
(Visual Studio) Go to your project properties, and set Configuration and Platform options to All
-
(Visual Studio) Go to C/C++ -> General. Add
$(ProjectDir)includetoAdditional Include Directoriesif it is not already there -
(Visual Studio) Go to Linker -> General. Add
$(ProjectDir)librariestoAdditional Library Directoriesif it is not already there -
(Visual Studio) Go to Linker -> Input. Add
glew32s.libtoAdditional Dependencies -
(Visual Studio) Go to C/C++ -> Preprocessor. Add
GLEW_STATICtoPreprocessor Definitions
The Graphics Library Framework is useful for assisting in simple window creation and input handling. The following guide will help enable it in your environment:
-
Download GLEW at : https://www.glfw.org/download.html
-
After extracting all files, move the
GLFWfolder to your project'sincludedirectory -
Copy the library files in
lib-vc2015to your project'slibrariesdirectory -
(Visual Studio) Go to your project properties, and set Configuration and Platform options to All
-
(Visual Studio) Go to C/C++ -> General. Add
$(ProjectDir)includetoAdditional Include Directoriesif it is not already there -
(Visual Studio) Go to Linker -> General. Add
$(ProjectDir)librariestoAdditional Library Directoriesif it is not already there -
(Visual Studio) Go to Linker -> Input. Add
glfw3.libtoAdditional Dependencies
Note : this guide is primarily targeted at setting up a Windows development environment. You can probably just use your package manager on Linux.
-
Download boost at : https://www.boost.org/users/history/version_1_69_0.html
-
Extract into the
Engineproject directory -
Run
bootstrap.batorbootstrap.shdepending on your development environment -
Run the newly generated
b2executable (this will take a while) -
(Visual Studio) Go to your project properties, and set Configuration and Platform options to All
-
(Visual Studio) Add
$(ProjectDir)Engine\boost_1_69_0toInclude Directories -
(Visual Studio) Add
$(ProjectDir)Engine\boost_1_69_0\stage\libtoLibrary Directories
Note : this guide is primarily targeted at setting up a Windows development environment. You can probably just use your package manager on Linux.
-
Download and extract the LuaJIT zip file from the Team Drive
-
Copy the
lua51.libandlua51.dllfiles from thesrcdirectory into your projectlibrariesdirectory and build location -
Copy the entire
srcdirectory into your projectincludesdirectory, and rename it toluajit-2.0 -
Add
lua51.libto your project's linked library settings