This commit is contained in:
Бранимир Караџић
2019-01-10 22:12:16 -08:00
parent 17d2f13f35
commit 6e75f9f663

View File

@@ -13,8 +13,8 @@
#include "topology.h"
#if BX_PLATFORM_OSX
#include <objc/message.h>
#endif
# include <objc/message.h>
#endif // BX_PLATFORM_OSX
BX_ERROR_RESULT(BGFX_ERROR_TEXTURE_VALIDATION, BX_MAKEFOURCC('b', 'g', 0, 1) );
@@ -2186,30 +2186,32 @@ namespace bgfx
}
}
}
#if BX_PLATFORM_OSX
struct NSAutoreleasePoolScope
{
NSAutoreleasePoolScope()
{
id obj = class_createInstance(objc_getClass("NSAutoreleasePool"),0);
pool = objc_msgSend(obj, sel_getUid("init"));
id obj = class_createInstance(objc_getClass("NSAutoreleasePool"), 0);
pool = objc_msgSend(obj, sel_getUid("init") );
}
~NSAutoreleasePoolScope()
{
objc_msgSend(pool, sel_getUid("release"));
objc_msgSend(pool, sel_getUid("release") );
}
id pool;
};
#endif
#endif // BX_PLATFORM_OSX
RenderFrame::Enum Context::renderFrame(int32_t _msecs)
{
BGFX_PROFILER_SCOPE("bgfx::renderFrame", 0xff2040ff);
#if BX_PLATFORM_OSX
NSAutoreleasePoolScope pool;
#endif
#endif // BX_PLATFORM_OSX
if (!m_flipAfterRender)
{