Browse Source

Merge branch 'dev' of github.com:oxygine/oxygine-framework into dev

dmuratshin 9 years ago
parent
commit
51fb292347

+ 7 - 0
oxygine/src/DebugActor.cpp

@@ -32,6 +32,8 @@
 
 #ifdef __S3E__
 #include "s3eMemory.h"
+#elif __APPLE__
+#include "core/ios/ios.h"
 #endif
 
 namespace oxygine
@@ -294,6 +296,11 @@ namespace oxygine
         s << "update=" << getStage()->_statUpdate << "ms ";
         s << "render=" << getStage()->_statRender << "ms ";
         s << "textures=" << NativeTexture::created << " ";
+#ifdef __APPLE__
+        size_t mem;
+        iosGetMemoryUsage(mem);
+        s << "memory=" << mem/1024 << "kb ";
+#endif
         //s << "\nlisteners=" << getStage()->getListenersCount() << "";
 
         if (!_debugText.empty())

+ 2 - 0
oxygine/src/core/ios/ios.h

@@ -12,4 +12,6 @@ namespace oxygine
     class MemoryTexture;
 
     bool nsImageLoad(MemoryTexture& mt, void* pData, int nDatalen, bool premultiplied, TextureFormat format);
+    
+    void iosGetMemoryUsage(size_t &a);
 }

+ 17 - 0
oxygine/src/core/ios/ios.mm

@@ -9,6 +9,8 @@
 #include "ios.h"
 #include "MemoryTexture.h"
 
+#import <mach/mach.h>
+
 namespace oxygine
 {
 	namespace file
@@ -135,4 +137,19 @@ namespace oxygine
         return true;
     }
 #endif
+    
+    void iosGetMemoryUsage(size_t &a)
+    {
+        struct task_basic_info info;
+        mach_msg_type_number_t size = sizeof(info);
+        kern_return_t kerr = task_info(mach_task_self(),
+                                       TASK_BASIC_INFO,
+                                       (task_info_t)&info,
+                                       &size);
+        if( kerr == KERN_SUCCESS ) {
+            a = info.resident_size;
+        } else {
+            a = 0;
+        }
+    }
 }

+ 1 - 0
oxygine/src/core/oxygine.cpp

@@ -356,6 +356,7 @@ namespace oxygine
 #if TARGET_OS_IPHONE
             flags |= SDL_WINDOW_BORDERLESS;
             flags |= SDL_WINDOW_ALLOW_HIGHDPI;
+            flags |= SDL_WINDOW_FULLSCREEN;
 #endif
 
             //SDL_DisplayMode mode;