all opengl instance functions

This commit is contained in:
Gregory Wells
2025-07-10 15:24:59 -04:00
parent fbd4c01e73
commit af1f028088
9 changed files with 8041 additions and 4 deletions

View File

@@ -0,0 +1,5 @@
#include "opengl_output_device.h"
gnReturnCode createOpenGLOutputDevice(gnOutputDeviceHandle outputDevice, gnInstanceHandle instance, gnOutputDeviceInfo deviceInfo) { return GN_SUCCESS; }
void waitForOpenGLDevice(const gnOutputDeviceHandle device) {}
void destroyOpenGLOutputDevice(gnOutputDeviceHandle device) {}

View File

@@ -0,0 +1,8 @@
#pragma once
#include <output_device/gryphn_output_device.h>
typedef struct gnPlatformOutputDevice_t {} gnPlatformOutputDevice;
gnReturnCode createOpenGLOutputDevice(gnOutputDeviceHandle outputDevice, gnInstanceHandle instance, gnOutputDeviceInfo deviceInfo);
void waitForOpenGLDevice(const gnOutputDeviceHandle device);
void destroyOpenGLOutputDevice(gnOutputDeviceHandle device);

View File

@@ -1,3 +1,4 @@
#include <glad/glad.h>
#include "opengl_surface.h"
#ifdef GN_PLATFORM_LINUX
@@ -18,6 +19,8 @@ gnReturnCode createGLXContext(gnWindowSurfaceHandle windowSurface, gnInstanceHan
return GN_FAILED_TO_ATTACH_WINDOW;
windowSurface->windowSurface->window = createInfo.window;
windowSurface->windowSurface->display = createInfo.display;
if (!gladLoadGLLoader((GLADloadproc)glXGetProcAddress))
return GN_FAILED_TO_INIT_OPENGL;
return GN_SUCCESS;
}
@@ -58,3 +61,7 @@ gnSurfaceDetails genOpenGLSurfaceDetails(
return surfaceDetails;
}
void destroyOpenGLSurface(gnWindowSurface surface) {
free(surface->windowSurface);
}

View File

@@ -16,3 +16,4 @@ gnReturnCode createGLXContext(gnWindowSurfaceHandle windowSurface, gnInstanceHan
gnUInt2 getWindowSize(gnPlatformWindowSurface* surface);
gnSurfaceDetails genOpenGLSurfaceDetails(gnWindowSurfaceHandle windowSurface, gnPhysicalDevice device);
void destroyOpenGLSurface(gnWindowSurface surface);