WinRT: removed an unneeded class created by MSVC 11's Direct3D template app
authorDavid Ludwig <dludwig@pobox.com>
Sun, 28 Oct 2012 19:47:33 -0400
changeset 8330 d976f30d38e9
parent 8329 c3047b88e35b
child 8331 737dc8a4f49f
WinRT: removed an unneeded class created by MSVC 11's Direct3D template app
VisualC/SDL/SDL_VS2012_WinRT.vcxproj
src/video/windowsrt/BasicTimer.h
src/video/windowsrt/SDL_WinRTApp.cpp
--- a/VisualC/SDL/SDL_VS2012_WinRT.vcxproj	Sun Oct 28 18:45:33 2012 -0400
+++ b/VisualC/SDL/SDL_VS2012_WinRT.vcxproj	Sun Oct 28 19:47:33 2012 -0400
@@ -238,7 +238,6 @@
     <ClInclude Include="..\..\src\video\SDL_RLEaccel_c.h" />
     <ClInclude Include="..\..\src\video\SDL_shape_internals.h" />
     <ClInclude Include="..\..\src\video\SDL_sysvideo.h" />
-    <ClInclude Include="..\..\src\video\windowsrt\BasicTimer.h" />
     <ClInclude Include="..\..\src\video\windowsrt\CubeRenderer.h" />
     <ClInclude Include="..\..\src\video\windowsrt\Direct3DBase.h" />
     <ClInclude Include="..\..\src\video\windowsrt\DirectXHelper.h" />
--- a/src/video/windowsrt/BasicTimer.h	Sun Oct 28 18:45:33 2012 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +0,0 @@
-#pragma once
-
-#include <wrl.h>
-
-// Helper class for basic timing.
-ref class BasicTimer sealed
-{
-public:
-	// Initializes internal timer values.
-	BasicTimer()
-	{
-		if (!QueryPerformanceFrequency(&m_frequency))
-		{
-			throw ref new Platform::FailureException();
-		}
-		Reset();
-	}
-	
-	// Reset the timer to initial values.
-	void Reset()
-	{
-		Update();
-		m_startTime = m_currentTime;
-		m_total = 0.0f;
-		m_delta = 1.0f / 60.0f;
-	}
-	
-	// Update the timer's internal values.
-	void Update()
-	{
-		if (!QueryPerformanceCounter(&m_currentTime))
-		{
-			throw ref new Platform::FailureException();
-		}
-		
-		m_total = static_cast<float>(
-			static_cast<double>(m_currentTime.QuadPart - m_startTime.QuadPart) /
-			static_cast<double>(m_frequency.QuadPart)
-			);
-		
-		if (m_lastTime.QuadPart == m_startTime.QuadPart)
-		{
-			// If the timer was just reset, report a time delta equivalent to 60Hz frame time.
-			m_delta = 1.0f / 60.0f;
-		}
-		else
-		{
-			m_delta = static_cast<float>(
-				static_cast<double>(m_currentTime.QuadPart - m_lastTime.QuadPart) /
-				static_cast<double>(m_frequency.QuadPart)
-				);
-		}
-		
-		m_lastTime = m_currentTime;
-	}
-	
-	// Duration in seconds between the last call to Reset() and the last call to Update().
-	property float Total
-	{
-		float get() { return m_total; }
-	}
-	
-	// Duration in seconds between the previous two calls to Update().
-	property float Delta
-	{
-		float get() { return m_delta; }
-	}
-
-private:
-	LARGE_INTEGER m_frequency;
-	LARGE_INTEGER m_currentTime;
-	LARGE_INTEGER m_startTime;
-	LARGE_INTEGER m_lastTime;
-	float m_total;
-	float m_delta;
-};
--- a/src/video/windowsrt/SDL_WinRTApp.cpp	Sun Oct 28 18:45:33 2012 -0400
+++ b/src/video/windowsrt/SDL_WinRTApp.cpp	Sun Oct 28 19:47:33 2012 -0400
@@ -1,6 +1,5 @@
 #include "SDLmain_WinRT_common.h"
 #include "SDL_WinRTApp.h"
-#include "BasicTimer.h"
 
 extern "C" {
 #include "SDL_assert.h"
@@ -90,15 +89,12 @@
         SDL_WinRT_main(argc, argv);
     }
 
-	BasicTimer^ timer = ref new BasicTimer();
-
 	while (!m_windowClosed)
 	{
 		if (m_windowVisible)
 		{
-			timer->Update();
 			CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessAllIfPresent);
-			m_renderer->Update(timer->Total, timer->Delta);
+			m_renderer->Update(0.0f, 0.0f);
 			m_renderer->Render();
 			m_renderer->Present(); // This call is synchronized to the display frame rate.
 		}