#pragma once #include "../Macros.h" #include "../Types.h" #import #include CC_BACKEND_BEGIN class Utils { public: static void updateDefaultColorAttachmentTexture(id texture); static MTLPixelFormat getDefaultDepthStencilAttachmentPixelFormat(); static MTLPixelFormat getDefaultColorAttachmentPixelFormat(); static id getDefaultDepthStencilTexture(); static MTLPixelFormat toMTLPixelFormat(TextureFormat textureFormat); static void generateMipmaps(id texture); static void getTextureBytes(int origX, int origY, int rectWidth, int rectHeight, id texture, std::function callback); static void swizzleImage(unsigned char* image, int width, int height, MTLPixelFormat format); private: static id createDepthStencilAttachmentTexture(); static id _defaultColorAttachmentTexture; static id _defaultDepthStencilAttachmentTexture; }; CC_BACKEND_END