write gryphn surface creation util for MacOS
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
#define GRYPHN_INCLUDE
|
||||||
#include <platform/gryphn_platform_include.h>
|
#include <platform/gryphn_platform_include.h>
|
||||||
#include <core/instance/init/gryphn_init.h>
|
#include <core/instance/init/gryphn_init.h>
|
||||||
#include <core/instance/gryphn_instance.h>
|
#include <core/instance/gryphn_instance.h>
|
||||||
|
24
include/gryphn/utils/gryphn_glfw_util.h
Normal file
24
include/gryphn/utils/gryphn_glfw_util.h
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
#pragma once
|
||||||
|
#ifndef GRYPHN_INCLUDE
|
||||||
|
#error "Must inclue gryphn.h before using this file"
|
||||||
|
#endif
|
||||||
|
#ifndef _glfw3_h_
|
||||||
|
#error "Must include glfw before using this file"
|
||||||
|
#endif
|
||||||
|
#ifndef _glfw3_native_h_
|
||||||
|
#error "Must include glfwnative before using this file"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef GN_PLATFORM_MACOS
|
||||||
|
#ifndef GLFW_EXPOSE_NATIVE_COCOA
|
||||||
|
#error "Must define GLFW_EXPOSE_NATIVE_COCOA on macos"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
gnReturnCode gnCreateGLFWWindowSurface(struct gnWindowSurface_t* windowSurface, struct gnInstance_t* instance, GLFWwindow* window) {
|
||||||
|
gnMacOSWindowSurfaceInfo surfaceCreateInfo = {
|
||||||
|
.window = (NSWindow*)glfwGetCocoaWindow(window)
|
||||||
|
};
|
||||||
|
return gnCreateMacOSWindowSurface(windowSurface, instance, surfaceCreateInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
Reference in New Issue
Block a user