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
#endif
Use 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
GL
folder located inglew-2.1.0\include
to your project'sinclude
directory -
Copy the library files in
glew-2.1.0\lib\Release\x64
to your project'slibraries
directory -
(Visual Studio) Go to your project properties, and set Configuration and Platform options to All
-
(Visual Studio) Go to C/C++ -> General. Add
$(ProjectDir)include
toAdditional Include Directories
if it is not already there -
(Visual Studio) Go to Linker -> General. Add
$(ProjectDir)libraries
toAdditional Library Directories
if it is not already there -
(Visual Studio) Go to Linker -> Input. Add
glew32s.lib
toAdditional Dependencies
-
(Visual Studio) Go to C/C++ -> Preprocessor. Add
GLEW_STATIC
toPreprocessor 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
GLFW
folder to your project'sinclude
directory -
Copy the library files in
lib-vc2015
to your project'slibraries
directory -
(Visual Studio) Go to your project properties, and set Configuration and Platform options to All
-
(Visual Studio) Go to C/C++ -> General. Add
$(ProjectDir)include
toAdditional Include Directories
if it is not already there -
(Visual Studio) Go to Linker -> General. Add
$(ProjectDir)libraries
toAdditional Library Directories
if it is not already there -
(Visual Studio) Go to Linker -> Input. Add
glfw3.lib
toAdditional 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
Engine
project directory -
Run
bootstrap.bat
orbootstrap.sh
depending on your development environment -
Run the newly generated
b2
executable (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_0
toInclude Directories
-
(Visual Studio) Add
$(ProjectDir)Engine\boost_1_69_0\stage\lib
toLibrary 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.lib
andlua51.dll
files from thesrc
directory into your projectlibraries
directory and build location -
Copy the entire
src
directory into your projectincludes
directory, and rename it toluajit-2.0
-
Add
lua51.lib
to your project's linked library settings