create basic OpenGL stuff
This commit is contained in:
@@ -9,10 +9,12 @@ if (UNIX AND NOT APPLE)
|
|||||||
GN_PLATFORM_LINUX
|
GN_PLATFORM_LINUX
|
||||||
GN_WINDOW_X11
|
GN_WINDOW_X11
|
||||||
|
|
||||||
GN_API_VULKAN
|
GN_API_VULKAN GN_API_OPENGL
|
||||||
)
|
)
|
||||||
set(VULKAN_BUILT ON)
|
|
||||||
add_subdirectory(projects/apis/vulkan/)
|
add_subdirectory(projects/apis/vulkan/)
|
||||||
|
add_subdirectory(projects/apis/opengl/)
|
||||||
|
set(VULKAN_BUILT ON)
|
||||||
|
set(OPENGL_BUILT ON)
|
||||||
endif()
|
endif()
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
add_compile_definitions(
|
add_compile_definitions(
|
||||||
@@ -39,3 +41,6 @@ endif()
|
|||||||
if (METAL_BUILT)
|
if (METAL_BUILT)
|
||||||
target_link_libraries(Gryphn INTERFACE GryphnMetalImpl)
|
target_link_libraries(Gryphn INTERFACE GryphnMetalImpl)
|
||||||
endif()
|
endif()
|
||||||
|
if (OPENGL_BUILT)
|
||||||
|
target_link_libraries(Gryphn INTERFACE GryphnOpenGLImpl)
|
||||||
|
endif()
|
||||||
|
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