make some gryphn stuff happen (DOES NOT COMPILE)

This commit is contained in:
Gregory Wells
2025-06-24 13:04:33 -04:00
parent 78202825db
commit 1915166c82
21 changed files with 150 additions and 294 deletions

View File

@@ -0,0 +1,50 @@
#pragma once
#include "stdint.h"
#include "utils/gryphn_error_code.h"
#include "utils/gryphn_bool.h"
#include "gryphn_handles.h"
typedef struct gnInstanceInfo gnInstanceInfo;
typedef struct gnPhysicalDevice gnPhysicalDevice;
typedef struct gnSurfaceDetails gnSurfaceDetails;
typedef struct gnOutputDeviceInfo gnOutputDeviceInfo;
#ifdef GN_PLATFORM_LINUX
#ifdef GN_WINDOW_X11
typedef struct gnX11WindowSurfaceInfo gnX11WindowSurfaceInfo;
#endif
#endif
typedef struct gnInstanceFunctions {
gnReturnCode (*_gnCreateInstance)(gnInstanceHandle instance, gnInstanceInfo info);
void (*_gnDestroyInstance)(gnInstanceHandle instance);
gnPhysicalDevice* (*_gnGetPhysicalDevices)(gnInstanceHandle instance, uint32_t* count);
gnBool (*_gnQueueCanPresentToSurface)(const gnPhysicalDevice device, uint32_t queueIndex, const gnWindowSurfaceHandle windowSurface);
gnReturnCode (*_gnCreateOutputDevice)(gnOutputDeviceHandle device, gnInstanceHandle instance, gnOutputDeviceInfo deviceInfo);
void (*_gnDestroyOutputDevice)(gnOutputDeviceHandle device);
#ifdef GN_PLATFORM_LINUX
#ifdef GN_WINDOW_X11
gnReturnCode (*_gnCreateX11WindowSurface)(gnWindowSurfaceHandle windowSurface, gnInstanceHandle instance, gnX11WindowSurfaceInfo createInfo);
#endif
#ifdef GN_WINDOW_WAYLAND
gnReturnCode (*_gnCreateWaylandWindowSurface)(gnWindowSurfaceHandle windowSurface, gnInstanceHandle instance, struct gnWaylandWindowSurfaceInfo_t createInfo);
#endif
#endif
#ifdef GN_PLATFORM_WIN32
gnReturnCode (*_gnCreateWin32WindowSurface)(gnWindowSurfaceHandle windowSurface, gnInstanceHandle instance, struct gnWin32WindowSurfaceInfo_t createInfo);
#endif
#ifdef GN_PLATFORM_MACOS
gnReturnCode (*_gnCreateMacOSWindowSurface)(gnWindowSurfaceHandle windowSurface, gnInstanceHandle instance, struct gnMacOSWindowSurfaceInfo_t createInfo);
#endif
void (*_gnDestroyWindowSurface)(gnWindowSurfaceHandle windowSurface);
gnSurfaceDetails (*_gnGetSurfaceDetails)(gnWindowSurfaceHandle windowSurface, gnPhysicalDevice device);
} gnInstanceFunctions;

View File

@@ -1,5 +1,7 @@
#include "gryphn_loader.h"
#include "stdio.h"
void test_loader() {
printf("Loader works %i\n", 32);
gnInstanceFunctions loadInstanceFunctions(gnRenderingAPI api) {
printf("Loading instance functions");
return (gnInstanceFunctions){ NULL };
}

View File

@@ -1,3 +1,5 @@
#pragma once
#include "gryphn_rendering_api.h"
#include "gryphn_instance_functions.h"
void test_loader();
gnInstanceFunctions loadInstanceFunctions(gnRenderingAPI api);