62 lines
3.1 KiB
C
62 lines
3.1 KiB
C
#pragma once
|
|
#include "stdint.h"
|
|
#include "core/gryphn_return_code.h"
|
|
#include "utils/gryphn_bool.h"
|
|
#include "gryphn_handles.h"
|
|
#include "gryphn_allocators.h"
|
|
|
|
typedef struct gnInstanceCreateInfo gnInstanceCreateInfo;
|
|
typedef struct gnSurfaceDetails gnSurfaceDetails;
|
|
typedef struct gnOutputDeviceInfo gnOutputDeviceInfo;
|
|
typedef enum gnSuitableField gnSuitableField;
|
|
typedef struct gnPhysicalDeviceProperties gnPhysicalDeviceProperties;
|
|
typedef struct gnPhysicalDeviceFeatures gnPhysicalDeviceFeatures;
|
|
typedef struct gnPhysicalDeviceLimits gnPhysicalDeviceLimits;
|
|
|
|
#ifdef GN_PLATFORM_LINUX
|
|
#ifdef GN_WINDOW_X11
|
|
typedef struct gnX11WindowSurfaceInfo gnX11WindowSurfaceInfo;
|
|
#endif
|
|
#endif
|
|
#ifdef GN_PLATFORM_MACOS
|
|
typedef struct gnMacOSWindowSurfaceInfo gnMacOSWindowSurfaceInfo;
|
|
#endif
|
|
|
|
typedef struct gryphnInstanceFunctionLayers gryphnInstanceFunctionLayers;
|
|
typedef gnReturnCode (*PFN_gnCreateInstance)(gnInstanceHandle, gnInstanceCreateInfo*, gryphnInstanceFunctionLayers*, gnAllocators*);
|
|
typedef gnBool (*PFN_gnIsInstanceSuitable)(gnInstanceHandle, gnSuitableField, gryphnInstanceFunctionLayers*);
|
|
typedef gnReturnCode (*PFN_gnInstanceQueryDevices)(gnInstanceHandle, uint32_t*, gnPhysicalDeviceHandle*, gryphnInstanceFunctionLayers*);
|
|
typedef void (*PFN_gnDestroyInstance)(gnInstanceHandle, gryphnInstanceFunctionLayers*, gnAllocators*);
|
|
|
|
typedef gnPhysicalDeviceProperties (*PFN_gnQueryPhysicalDeviceProperties)(gnInstance, gnPhysicalDeviceHandle, gryphnInstanceFunctionLayers*);
|
|
typedef gnPhysicalDeviceFeatures (*PFN_gnQueryPhysicalDeviceFeatures)(gnInstanceHandle, gnPhysicalDeviceHandle, gryphnInstanceFunctionLayers*);
|
|
typedef gnPhysicalDeviceLimits (*PFN_gnQueryPhysicalDeviceLimits)(gnInstanceHandle, gnPhysicalDeviceHandle, gryphnInstanceFunctionLayers*);
|
|
|
|
typedef struct gnInstanceFunctions {
|
|
gnBool (*_gnPhysicalDeviceCanPresentToSurface)(gnInstance instance, gnPhysicalDevice device, gnWindowSurfaceHandle windowSurface);
|
|
|
|
gnReturnCode (*_gnCreateOutputDevice)(gnInstanceHandle instance, gnOutputDeviceHandle device, 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, gnWaylandWindowSurfaceInfo createInfo);
|
|
#endif
|
|
#endif
|
|
|
|
|
|
#ifdef GN_PLATFORM_WIN32
|
|
gnReturnCode (*_gnCreateWin32WindowSurface)(gnWindowSurfaceHandle windowSurface, gnInstanceHandle instance, gnWin32WindowSurfaceInfo createInfo);
|
|
#endif
|
|
|
|
#ifdef GN_PLATFORM_MACOS
|
|
gnReturnCode (*_gnCreateMacOSWindowSurface)(gnWindowSurfaceHandle windowSurface, gnInstanceHandle instance, gnMacOSWindowSurfaceInfo createInfo);
|
|
#endif
|
|
|
|
void (*_gnDestroyWindowSurface)(gnWindowSurfaceHandle windowSurface);
|
|
gnSurfaceDetails (*_gnGetSurfaceDetails)(gnWindowSurfaceHandle windowSurface, gnPhysicalDevice device);
|
|
} gnInstanceFunctions;
|