|
From: <axl...@us...> - 2009-01-01 03:44:17
|
Revision: 132
http://hgengine.svn.sourceforge.net/hgengine/?rev=132&view=rev
Author: axlecrusher
Date: 2009-01-01 03:44:13 +0000 (Thu, 01 Jan 2009)
Log Message:
-----------
update for message system
Modified Paths:
--------------
Mercury2/src/Mercury2.cpp
Modified: Mercury2/src/Mercury2.cpp
===================================================================
--- Mercury2/src/Mercury2.cpp 2009-01-01 03:40:46 UTC (rev 131)
+++ Mercury2/src/Mercury2.cpp 2009-01-01 03:44:13 UTC (rev 132)
@@ -12,7 +12,7 @@
#include <MercuryCrash.h>
#include <MercuryBacktrace.h>
-
+#include <MercuryMessageManager.h>
MSemaphore UpdateLoopGo;
void* UpdateThread(void* node)
{
@@ -37,7 +37,9 @@
int main()
{
unsigned long m_count = 0;
-
+ uint64_t startTime = GetTimeInMicroSeconds();
+ uint64_t timeSinceStart = 0;
+
cnset_execute_on_crash( SignalHandler );
MercuryWindow* w = MercuryWindow::MakeWindow();
@@ -50,30 +52,30 @@
SAFE_DELETE(doc);
- uint64_t oTime = GetTimeInMicroSeconds();
+ uint64_t oTime = timeSinceStart;
uint64_t m_time = oTime;
//uncomment the next 2 lines to use threads
// MercuryThread updateThread;
// updateThread.Create( UpdateThread, root, false);
-
do
{
- uint64_t curTime = GetTimeInMicroSeconds();
- root->RecursiveUpdate((curTime-oTime)/1000000.0f); //comment to use threads
+ timeSinceStart = GetTimeInMicroSeconds() - startTime;
+ MESSAGEMAN::GetInstance().PumpMessages( timeSinceStart );
+ root->RecursiveUpdate((timeSinceStart-oTime)/1000000.0f); //comment to use threads
RenderableNode::RecursiveRender(root);
w->SwapBuffers();
++m_count;
- float seconds = (curTime-m_time)/1000000.0f;
+ float seconds = (timeSinceStart-m_time)/1000000.0f;
if (seconds > 1)
{
- m_time = curTime;
+ m_time = timeSinceStart;
printf("FPS: %f\n", m_count/seconds);
m_count = 0;
}
- oTime = curTime;
+ oTime = timeSinceStart;
}
while ( w->PumpMessages() );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|