Explorar o código

Added getScreenWidth and getScreenHeight wrapper methods to Core

Ivan Safrin %!s(int64=12) %!d(string=hai) anos
pai
achega
83c2f0104d
Modificáronse 2 ficheiros con 15 adicións e 0 borrados
  1. 3 0
      Core/Contents/Include/PolyCore.h
  2. 12 0
      Core/Contents/Source/PolyCore.cpp

+ 3 - 0
Core/Contents/Include/PolyCore.h

@@ -232,6 +232,9 @@ namespace Polycode {
 		*/
 		static void getScreenInfo(int *width, int *height, int *hz);
 
+        int getScreenWidth();
+        int getScreenHeight();
+        
 		/**
 		* Creates a folder on disk with the specified path.
 		* @param folderPath Path to create the folder in.

+ 12 - 0
Core/Contents/Source/PolyCore.cpp

@@ -83,6 +83,18 @@ namespace Polycode {
 		refreshInterval = 1000 / frameRate;		
 		threadedEventMutex = NULL;
 	}
+    
+    int Core::getScreenWidth() {
+        int width, height, hz;
+        getScreenInfo(&width, &height, &hz);
+        return width;
+    }
+    
+    int Core::getScreenHeight() {
+        int width, height, hz;
+        getScreenInfo(&width, &height, &hz);
+        return height;
+    }
 	
 	void Core::setFramerate(int frameRate) {
 		refreshInterval = 1000 / frameRate;