Permalink
Browse files

Added tick rate and cstr + dstr for engine as well as a endgame funct…

…ion in engine for shutting everything down safely
  • Loading branch information...
1 parent a40499c commit 18f883150a5dbeb86036a048d19163355c6f61c8 @mmavipc committed Apr 24, 2012
Showing with 33 additions and 4 deletions.
  1. +1 −0 Core/Core.h
  2. +21 −2 Core/Engine/Engine.cpp
  3. +10 −1 Core/Engine/Engine.h
  4. +1 −1 Test-Implementation/Test-Implementation.cpp
View
@@ -3,6 +3,7 @@
#include "CoreExport.h"
+//namespace C
extern "C"
{
COREEXPORT void* GetEngine();
View
@@ -1,6 +1,25 @@
#include "Engine.h"
+#ifdef _WIN32
+//#include <Windows.h>
+#endif
-void Mavgine2::Engine::Initialize(const std::string &strGameName)
+Mavgine2::Engine::Engine() : m_uiTickRate(0)
{
- //TODO: implement this
+}
+
+Mavgine2::Engine::~Engine()
+{
+}
+
+void Mavgine2::Engine::Initialize(const std::string &strGameName, const unsigned int uiTickRate)
+{
+ m_uiTickRate = uiTickRate;
+}
+
+void Mavgine2::Engine::EndGame()
+{
+ delete this;
+#ifdef _WIN32
+ exit(0);
+#endif
}
View
@@ -2,13 +2,22 @@
#define ENGINE_H
#include <string>
+#include "..\Core.h"
namespace Mavgine2
{
class Engine
{
+ friend void* ::GetEngine();
+
public:
- virtual void Initialize(const std::string &strGameName);
+ virtual void Initialize(const std::string &strGameName, const unsigned int uiTickRate);
+ virtual void EndGame();
+
+ private:
+ Engine();
+ ~Engine();
+ unsigned int m_uiTickRate;
};
};
@@ -20,6 +20,6 @@ int main(int argc, char* argv[])
#endif
Mavgine2::Engine *pEngine = (Mavgine2::Engine*)pGetEngineFunc();
- pEngine->Initialize("Test Implementation");
+ pEngine->Initialize("Test Implementation", 33);
return 0;
}

0 comments on commit 18f8831

Please sign in to comment.