diff --git a/217CR Resit Assignment - Basic Project.vcxproj b/217CR Resit Assignment - Basic Project.vcxproj
index 0f1669a..234f8bd 100644
--- a/217CR Resit Assignment - Basic Project.vcxproj
+++ b/217CR Resit Assignment - Basic Project.vcxproj
@@ -99,10 +99,12 @@
true
_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
true
+ Library Files\include
Console
true
+ Library Files
@@ -138,7 +140,18 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/217CR Resit Assignment - Basic Project.vcxproj.filters b/217CR Resit Assignment - Basic Project.vcxproj.filters
index 82c46ea..d455c8e 100644
--- a/217CR Resit Assignment - Basic Project.vcxproj.filters
+++ b/217CR Resit Assignment - Basic Project.vcxproj.filters
@@ -18,5 +18,30 @@
Source Files
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+
+
+ Resource Files
+
\ No newline at end of file
diff --git a/Cube.cpp b/Cube.cpp
new file mode 100644
index 0000000..962eee7
--- /dev/null
+++ b/Cube.cpp
@@ -0,0 +1,47 @@
+#include "Cube.h"
+
+//We can either hard code the values in GameObject (like in Cube())
+//or
+//We can use the GameEngine constructors to fill the values ( like in Cube(x, y, z, size))
+Cube::Cube()
+{
+ x = 0.0f;
+ y = 0.0f;
+ z = 0.0f;
+
+ r = 1.0f;
+ g = 0.0f;
+ b = 1.0f;
+
+ size = 1.0f;
+}
+
+Cube::Cube(float _x, float _y, float _z, float _size)
+ :GameObject(_x, _y, _z) //note the use of GameObject constructor
+{
+ size = _size;
+}
+
+Cube::Cube(float _x, float _y, float _z,
+ float _r, float _g, float _b,
+ float _size):
+ GameObject(_x, _y, _z, _r, _g, _b) //note the use of GameObject constructor
+{
+ size = _size;
+}
+
+//Position and colour a cube in the scene
+void Cube::Draw()
+{
+ glPushMatrix();
+ glTranslatef(x, y, z);
+ glColor3f(r, g, b);
+ glutSolidCube(size);
+ //glutWireCube(size) - if you'd rather see through it
+ glPopMatrix();
+}
+
+void Cube::Update(float deltaTime)
+{
+ //Cubes are static at the moment so nothing changes for them
+}
diff --git a/Cube.h b/Cube.h
new file mode 100644
index 0000000..f071b25
--- /dev/null
+++ b/Cube.h
@@ -0,0 +1,24 @@
+#pragma once
+
+#include "GameObject.h"
+
+//A basic cube class derived from a game object
+class Cube: public GameObject
+{
+public:
+ // -- variables --
+ float size;
+
+ // -- constructors/destructors --
+ Cube(); //default constructor - aka no values passed in (position at 0,0,0 - colour magenta - size 1)
+ Cube(float _x, float _y, float _z, float _size); //pass in a position and size
+ Cube(float _x, float _y, float _z,
+ float _r, float _g, float _b,
+ float _size); //pass in a position, colour and size
+ ~Cube() {}; //default destructor
+
+ // -- functions --
+ //Need to give definions to GameObject's pure virtual functions
+ virtual void Draw();
+ virtual void Update(float deltaTime);
+};
\ No newline at end of file
diff --git a/GameObject.cpp b/GameObject.cpp
new file mode 100644
index 0000000..f011446
--- /dev/null
+++ b/GameObject.cpp
@@ -0,0 +1,41 @@
+#include "GameObject.h"
+
+std::map GameObject::keys;
+std::map GameObject::specialKeys;
+
+GameObject::GameObject()
+{
+ x = 0.0f;
+ y = 0.0f;
+ z = 0.0f;
+
+ r = 1.0f;
+ g = 0.0f;
+ b = 1.0f;
+}
+
+GameObject::GameObject(float _x, float _y, float _z)
+{
+ x = _x;
+ y = _y;
+ z = _z;
+
+ r = 1.0f;
+ g = 1.0f;
+ b = 1.0f;
+}
+
+GameObject::GameObject(float _x, float _y, float _z, float _r, float _g, float _b)
+{
+ x = _x;
+ y = _y;
+ z = _z;
+
+ r = _r;
+ g = _g;
+ b = _b;
+}
+
+GameObject::~GameObject()
+{
+}
diff --git a/GameObject.h b/GameObject.h
new file mode 100644
index 0000000..2ee6450
--- /dev/null
+++ b/GameObject.h
@@ -0,0 +1,31 @@
+#pragma once
+
+#include
+#include
+
+#include