all opengl instance functions
This commit is contained in:
5
projects/apis/opengl/src/device/opengl_output_device.c
Normal file
5
projects/apis/opengl/src/device/opengl_output_device.c
Normal 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) {}
|
8
projects/apis/opengl/src/device/opengl_output_device.h
Normal file
8
projects/apis/opengl/src/device/opengl_output_device.h
Normal 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);
|
@@ -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);
|
||||
}
|
||||
|
@@ -16,3 +16,4 @@ gnReturnCode createGLXContext(gnWindowSurfaceHandle windowSurface, gnInstanceHan
|
||||
|
||||
gnUInt2 getWindowSize(gnPlatformWindowSurface* surface);
|
||||
gnSurfaceDetails genOpenGLSurfaceDetails(gnWindowSurfaceHandle windowSurface, gnPhysicalDevice device);
|
||||
void destroyOpenGLSurface(gnWindowSurface surface);
|
||||
|
Reference in New Issue
Block a user