create basic OpenGL stuff
This commit is contained in:
23
projects/apis/opengl/CMakeLists.txt
Normal file
23
projects/apis/opengl/CMakeLists.txt
Normal file
@@ -0,0 +1,23 @@
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS on)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
project(GryphnOpenGLImpl)
|
||||
|
||||
file(GLOB_RECURSE SOURCE_FILES CONFIGURE_DEPENDS
|
||||
"src/*.c"
|
||||
)
|
||||
file(GLOB_RECURSE LOADER_FILES CONFIGURE_DEPENDS
|
||||
"loader/*.c"
|
||||
)
|
||||
add_library(GryphnOpenGLImpl STATIC ${SOURCE_FILES} ${LOADER_FILES})
|
||||
target_include_directories(GryphnOpenGLImpl PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../core/src/
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../core/
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../extensions/
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../utils/
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../platform/
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../include/
|
||||
)
|
||||
add_compile_definitions(GN_REVEAL_IMPL)
|
||||
target_link_libraries(GryphnOpenGLImpl GL)
|
16
projects/apis/opengl/loader/opengl_instance_loader.c
Normal file
16
projects/apis/opengl/loader/opengl_instance_loader.c
Normal file
@@ -0,0 +1,16 @@
|
||||
#include "opengl_loader.h"
|
||||
#include "instance/opengl_instance.h"
|
||||
|
||||
gnInstanceFunctions loadOpenGLInstanceFunctions() {
|
||||
return (gnInstanceFunctions){
|
||||
._gnCreateInstance = createOpenGLInstance,
|
||||
._gnDestroyInstance = destroyOpenGLInstance,
|
||||
// ._gnGetPhysicalDevices = getMetalDevices,
|
||||
// ._gnQueueCanPresentToSurface = metalCanQueuePresentToSurface,
|
||||
// ._gnCreateOutputDevice = createMetalOutputDevice,
|
||||
// ._gnDestroyOutputDevice = destroyMetalOutputDevice,
|
||||
// ._gnCreateMacOSWindowSurface = createMetalSurface,
|
||||
// ._gnDestroyWindowSurface = destroyMetalWindowSurface,
|
||||
// ._gnGetSurfaceDetails = getMetalSurfaceDetails
|
||||
};
|
||||
}
|
8
projects/apis/opengl/loader/opengl_loader.h
Normal file
8
projects/apis/opengl/loader/opengl_loader.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#pragma once
|
||||
#include "loader/src/gryphn_instance_functions.h"
|
||||
#include "loader/src/gryphn_device_functions.h"
|
||||
#include "loader/src/gryphn_command_functions.h"
|
||||
|
||||
gnInstanceFunctions loadOpenGLInstanceFunctions();
|
||||
gnDeviceFunctions loadOpenGLDeviceFunctions();
|
||||
gnCommandFunctions loadOpenGLCommandFunctions();
|
8
projects/apis/opengl/src/instance/opengl_instance.c
Normal file
8
projects/apis/opengl/src/instance/opengl_instance.c
Normal file
@@ -0,0 +1,8 @@
|
||||
#include "opengl_instance.h"
|
||||
|
||||
gnReturnCode createOpenGLInstance(gnInstanceHandle instance, gnInstanceInfo instanceInfo) {
|
||||
return GN_SUCCESS;
|
||||
}
|
||||
void destroyOpenGLInstance(gnInstanceHandle instance) {
|
||||
|
||||
}
|
8
projects/apis/opengl/src/instance/opengl_instance.h
Normal file
8
projects/apis/opengl/src/instance/opengl_instance.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#pragma once
|
||||
#include <GL/gl.h>
|
||||
#include "instance/gryphn_instance.h"
|
||||
|
||||
typedef struct gnPlatformInstance_t {} gnPlatformInstance;
|
||||
|
||||
gnReturnCode createOpenGLInstance(gnInstanceHandle instance, gnInstanceInfo instanceInfo);
|
||||
void destroyOpenGLInstance(gnInstanceHandle instance);
|
Reference in New Issue
Block a user