conversion functions
This commit is contained in:
@@ -1,5 +1,10 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "core/window_surface/gryphn_surface.h"
|
#include "core/window_surface/gryphn_surface.h"
|
||||||
|
#import <QuartzCore/QuartzCore.h>
|
||||||
|
|
||||||
typedef struct gnPlatformWindowSurface_t{
|
typedef struct gnPlatformWindowSurface_t{
|
||||||
} gnPlatformWindowSurface;
|
} gnPlatformWindowSurface;
|
||||||
|
|
||||||
|
|
||||||
|
MTLPixelFormat mtlGryphnFormatToVulkanFormat(gnImageFormat format);
|
||||||
|
CGColorSpaceRef mtlGryphnColorSpaceToVulkanColorSpace(gnColorSpace colorSpace);
|
||||||
|
@@ -21,3 +21,16 @@ gnReturnCode gnCreateMacOSWindowSurfaceFn(struct gnWindowSurface_t* windowSurfac
|
|||||||
windowSurface->windowSurface = malloc(sizeof(gnPlatformWindowSurface));
|
windowSurface->windowSurface = malloc(sizeof(gnPlatformWindowSurface));
|
||||||
return GN_SUCCESS;
|
return GN_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MTLPixelFormat mtlGryphnFormatToVulkanFormat(gnImageFormat format) {
|
||||||
|
switch (format) {
|
||||||
|
case GN_FORMAT_BGRA8_SRGB: { return MTLPixelFormatBGRA8Unorm_sRGB; }
|
||||||
|
default: return MTLPixelFormatInvalid;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
CGColorSpaceRef mtlGryphnColorSpaceToVulkanColorSpace(gnColorSpace colorSpace) {
|
||||||
|
switch (colorSpace) {
|
||||||
|
case GN_COLOR_SPACE_SRGB_NONLINEAR: { return CGColorSpaceCreateWithName(kCGColorSpaceSRGB); }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user