Ver código fonte

Added new Render/Update separation to Windows Core

Ivan Safrin 12 anos atrás
pai
commit
d30258d26a

+ 1 - 1
Core/Contents/Include/PolyWinCore.h

@@ -182,7 +182,7 @@ public:
 		void warpCursor(int x, int y);
 		void warpCursor(int x, int y);
 		unsigned int getTicks();		
 		unsigned int getTicks();		
 		bool Update();
 		bool Update();
-
+		void Render();
 		void setVSync(bool vSyncVal);
 		void setVSync(bool vSyncVal);
 
 
 		void handleKeyDown(LPARAM lParam, WPARAM wParam, wchar_t unicodeChar);
 		void handleKeyDown(LPARAM lParam, WPARAM wParam, wchar_t unicodeChar);

+ 8 - 7
Core/Contents/Source/PolyWinCore.cpp

@@ -150,19 +150,20 @@ unsigned int Win32Core::getTicks() {
 	return GetTickCount();
 	return GetTickCount();
 }
 }
 
 
+void Win32Core::Render() {
+	renderer->BeginRender();
+	services->Render();
+	renderer->EndRender();
+	SwapBuffers(hDC);
+}
+
 bool Win32Core::Update() {
 bool Win32Core::Update() {
 	if(!running)
 	if(!running)
 		return false;
 		return false;
-
+	doSleep();
 	checkEvents();
 	checkEvents();
 	Gamepad_processEvents();
 	Gamepad_processEvents();
-
-	renderer->BeginRender();
 	updateCore();
 	updateCore();
-	renderer->EndRender();
-	
-	SwapBuffers(hDC);
-	doSleep();
 	return running;
 	return running;
 }
 }