gryphn window surfaces

This commit is contained in:
Greg Wells
2025-05-22 18:14:03 -04:00
parent 692b5a0f19
commit 6c43eb026d
17 changed files with 243 additions and 119 deletions

View File

@@ -26,26 +26,3 @@ typedef struct gnInstance_t {
gnReturnCode gnCreateInstance(gnInstance* instance, struct gnInstanceInfo_t info);
void gnDestroyInstance(gnInstance* instance);
// // inline gnReturnCode (*gnInstanceSetWindow)(gnInstance& instance, GLFWwindow* window);
// #ifdef GN_PLATFORM_LINUX
// #ifdef GN_WINDOW_X11
// inline gnReturnCode (*gnCreateX11WindowSurface)(gnInstance& instance, Display* display, Window* window);
// #endif
// #ifdef GN_WINDOW_WAYLAND
// inline gnReturnCode (*gnCreateWaylandWindowSurface)(gnInstance& instance, wl_display* display, wl_surface* surface);
// #endif
// #endif
// #ifdef GN_PLATFORM_WIN32
// inline gnReturnCode (*gnCreateWindowsWindowSurface)(gnInstance& instance, HWND* window, HINSTANCE* instance);
// #endif
// #ifdef GN_PLATFORM_MACOS
// typedef void* NSWindow;
// typedef void* NSView;
// inline gnReturnCode (*gnCreateMacOSWindowSurface)(gnInstance& instance, NSWindow window, NSView view);
// #endif

View File

@@ -3,6 +3,7 @@
#include <platform/gryphn_platform_include.h>
#include "gryphn_dynamic_library.h"
// #include <dlfcn.h>
#include "stdio.h"
gnBool gnIsAPISupported(gnRenderingAPI api) {
int renderingAPICount = 0;
@@ -44,6 +45,28 @@ void gnLoadFunctions(struct gnDynamicLibrary_t* lib, struct gnFunctions_t* funct
gnLoadDLLFunction(lib, functions->_gnDeviceSupportsAPI, "gnDeviceSupportsAPIFn");
gnLoadDLLFunction(lib, functions->_gnRegisterOutputDevice, "gnRegisterOutputDeviceFn");
gnLoadDLLFunction(lib, functions->_gnDestroyOutputDevice, "gnDestroyOutputDeviceFn");
#ifdef GN_PLATFORM_LINUX
#ifdef GN_WINDOW_X11
gnLoadDLLFunction(lib, functions->_gnCreateX11WindowSurface, "gnCreateX11WindowSurfaceFn");
#endif
#ifdef GN_WINDOW_WAYLAND
gnLoadDLLFunction(lib, functions->_gnCreateWaylandWindowSurface, "gnCreateWaylandWindowSurfaceFn");
#endif
#endif
#ifdef GN_PLATFORM_WIN32
gnLoadDLLFunction(lib, functions->_gnCreateWin32WindowSurface, "gnCreateWin32WindowSurfaceFn");
#endif
#ifdef GN_PLATFORM_MACOS
gnLoadDLLFunction(lib, functions->_gnCreateMacOSWindowSurface, "gnCreateMacOSWindowSurfaceFn");
#endif
gnLoadDLLFunction(lib, functions->_gnDestroyWindowSurface, "gnDestroyWindowSurfaceFn");
printf("_gnDestroyWindowSurface location: %p\n", functions->_gnDestroyWindowSurface);
}
void gnLoadDeviceFunctions(struct gnDynamicLibrary_t* lib, struct gnDeviceFunctions_t* functions) {