Initial directory structure

This commit is contained in:
sippeangelo
2015-11-20 15:01:37 +01:00
commit 63674946ca
17 changed files with 208 additions and 0 deletions
Executable
+6
View File
@@ -0,0 +1,6 @@
# Build Folders
build/
bin/
lib/
# Because apparently nobody has any self control
*.orig
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
+76
View File
@@ -0,0 +1,76 @@
#include "StyleGuide.h"
namespace OuterNamespace
{
namespace InnerNamespace
{
// Constructor with initializer list
ClassType::ClassType(int arg1)
: BaseClassType(this),
, m_PrivateMember1(arg1)
{ }
// Destructor
ClassType::~ClassType()
{
if (m_PrivateMember2 != nullptr) {
delete m_PrivateMember2;
m_PrivateMember2 = nullptr;
}
}
// Base class virtual override
bool ClassType::PublicVirtualMemberFunction(bool value)
{
return BaseClassType::PublicVirtualMemberFunction(value);
}
// Base class pure virtual override
bool ClassName::PublicPureVirtualMemberFunction(bool value)
{
// Treat parenthesis as curly braces for functions with lots of arguments
manyArgumentFunction(
"abcdefghijklmnopqrstuvwxyz",
"abcdefghijklmnopqrstuvwxyz",
"abcdefghijklmnopqrstuvwxyz"
);
// For loops
int sum = 0;
for (int i = 0; i < 5; i++) {
for (int j = 0; j < 5; j++) {
// Math!
// 1. Group multiplication and division operands
// 2. Separate addition and subtraction with space
sum = sum + i*j;
}
}
// For-each loops
std::vector<int> vec;
for (auto& i : vec) {
if (i == 0) {
return true;
}
}
return false;
}
// Private member function
bool ClassName::privateMemberFunction()
{
switch (m_PrivateMember1) {
case 1:
m_PrivateMember2 = new ClassType(2);
break;
default:
return false;
}
return false;
}
}
}
+98
View File
@@ -0,0 +1,98 @@
#ifndef Namespace_FileName_h__
#define Namespace_FileName_h__
#include <standard_library>
#include <external_dependency>
// Relative paths preferred
#include "Internal/Header.h"
namespace OuterNamespace
{
namespace InnerNamespace
{
enum class EnumType
{
Red,
Green,
Blue
};
struct StructType
{
int PublicMember = 0;
};
template <typename T>
class BaseClassType
{
public:
BaseClassType(T* child)
: m_Child(child)
{ }
virtual bool PublicVirtualMemberFunction(bool value) { return value; }
virtual bool PublicPureVirtualMemberFunction(bool value) = 0;
private:
T* m_Child = nullptr;
};
class ClassType : public BaseClassType<ClassType>
{
public:
// Constructor
ClassType(int arg1);
// Destructor
~ClassType();
// Getter
int PrivateMember1() const { return m_PrivateMember1; } // Prefer copy for fundamental types
const StructType* PrivateMember2() const { return m_PrivateMember2; }
// Setter
void SetPrivateMember1(const int& privateMember1) { m_PrivateMember1 = privateMember1; }
void SetPrivateMember2(StructType* privateMember2) { m_PrivateMember2 = privateMember2; }
// Public templated member function
template <typename T>
T* PublicMemberFunction(bool value);
// Base class virtual override
bool PublicVirtualMemberFunction(bool value) override;
// Base class pure virtual override
bool PublicPureVirtualMemberFunction(bool value) override;
private:
// Private members with default values
int m_PrivateMember1 = 1;
StructType* m_PrivateMember2 = nullptr;
// Private member functions
bool privateMemberFunction();
void manyArgumentFunction(std::string arg1, std::string arg2, std::string arg3) { }
};
// Public templated member function
template <typename T>
T* ClassType::PublicMemberFunction(bool value)
{
if (m_PrivateMember2 == nullptr) {
return nullptr;
}
if (m_PrivateMember2->PublicMember == 1) {
return new T();
}
else {
return nullptr;
}
}
}
}
#endif
+28
View File
@@ -0,0 +1,28 @@
@ECHO off
SET DeployLocation=bin\
ECHO Deploying resources to %DeployLocation%
:: Asset folders
RMDIR "%DeployLocation%\Models"
RMDIR "%DeployLocation%\Textures"
RMDIR "%DeployLocation%\Sounds"
MKLINK "%DeployLocation%\Models\" "assets\Models" /J
MKLINK "%DeployLocation%\Textures\" "assets\Textures\" /J
MKLINK "%DeployLocation%\Sounds\" "assets\Sounds\" /J
:: Configuration files
MKLINK "%DeployLocation%\DefaultConfig.ini" "assets\DefaultConfig.ini" /H
:: Shaders
RMDIR /S /Q "%DeployLocation%\Shaders"
MKDIR "%DeployLocation%\Shaders"
MKLINK "%DeployLocation%\Shaders\OpenGL\" "src\game\Rendering\OpenGL\Shaders\" /J
MKLINK "%DeployLocation%\Shaders\DirectX\" "src\game\Rendering\DirectX\Shaders\" /J
:: Platform specific binaries
IF "%~1"=="" GOTO :EOF
ECHO Deploying %1 binaries to %DeployLocation%
COPY "deps\bin\%1\x64\*.dll" "%DeployLocation%"
:: Licenses
::COPY "libs\assimp-3.1.1\LICENSE" "%ConfigPath%\Assimp License.txt"
::COPY "libs\glew-1.11.0\LICENSE.txt" "%ConfigPath%\GLEW License.txt"
::COPY "libs\glm-0.9.5.4\copying.txt" "%ConfigPath%\GLM License.txt"
::COPY "libs\assimp-3.1.1\LICENSE" "%ConfigPath%\Assimp License.txt"