diff --git a/G3DTest.suo b/G3DTest.suo index b97defc..2ee9c13 100644 Binary files a/G3DTest.suo and b/G3DTest.suo differ diff --git a/G3DTest.vcproj b/G3DTest.vcproj index ba8956b..55b5f89 100644 --- a/G3DTest.vcproj +++ b/G3DTest.vcproj @@ -233,6 +233,10 @@ /> + + + + #include "Instance.h" +std::string name; +Instance* parent; +static const int BASE_INSTANCE = 0; +static const int PHYSICAL_INSTANCE = 1; +static const int type = BASE_INSTANCE; + Instance::Instance(void) { + name = "Default Game Instance"; } Instance::~Instance(void) { + name = "Default Game Instance"; } +int getType() +{ + return type; +} + + + diff --git a/Instance.h b/Instance.h index 31719c4..ca35656 100644 --- a/Instance.h +++ b/Instance.h @@ -5,4 +5,9 @@ class Instance public: Instance(void); ~Instance(void); + std::string name; + int getType(); + Instance* parent; // Another pointer. + static const int BASE_INSTANCE; + static const int PHYSICAL_INSTANCE; }; diff --git a/PhysicalInstance.cpp b/PhysicalInstance.cpp new file mode 100644 index 0000000..4e21366 --- /dev/null +++ b/PhysicalInstance.cpp @@ -0,0 +1,26 @@ +#include +#include "PhysicalInstance.h" + + +bool collides = true; +bool anchored = false; +Vector3 size; +Vector3 position; +Color3 color; +//static const int type = PHYSICAL_INSTANCE; + +PhysicalInstance::PhysicalInstance(void) +{ + name = "Default PhysicalInstance"; + collides = true; + anchored = true; + size = Vector3(2,1,4); + position = Vector3(0,0,0); + color = Color3::gray(); +} + +PhysicalInstance::~PhysicalInstance(void) +{ +} + + diff --git a/PhysicalInstance.h b/PhysicalInstance.h new file mode 100644 index 0000000..7cdde93 --- /dev/null +++ b/PhysicalInstance.h @@ -0,0 +1,10 @@ +#pragma once +#include "instance.h" + +class PhysicalInstance : + public Instance +{ +public: + PhysicalInstance(void); + ~PhysicalInstance(void); +}; diff --git a/main.cpp b/main.cpp index 3a651eb..edf9e7b 100644 --- a/main.cpp +++ b/main.cpp @@ -12,6 +12,7 @@ */ #include #include "Instance.h" +#include "PhysicalInstance.h" #if G3D_VER < 61000 #error Requires G3D 6.10 @@ -19,6 +20,7 @@ static const float VNUM = 0.01F; static const std::string VERSION = "PRE-ALPHA "; static std::vector Instances; +static Instance* dataModel; static GFontRef fntdominant = NULL; static GFontRef fntlighttrek = NULL; static bool democ = true; @@ -93,11 +95,17 @@ std::string Convert (float number){ void Demo::onInit() { // Called before Demo::run() beings + dataModel = new Instance(); + //dataModel->name = "undefined"; + dataModel->parent = NULL; + + PhysicalInstance* test = new PhysicalInstance(); setDesiredFrameRate(FPSVal[index]); app->debugCamera.setPosition(Vector3(0, 2, 10)); app->debugCamera.lookAt(Vector3(0, 2, 0)); //std::string str = "Dynamica Duomillenium 5 Version " + VERSION + Convert(VNUM); - std::string str = "Game \"undefined\""; + std::string str = "Game \"" + dataModel->name + "\""; + app->renderDevice->setCaption(str); GApplet::onInit(); }