write the functions for the command pool/buffers
This commit is contained in:
8
projects/apis/opengl/loader/opengl_commands_loader.c
Normal file
8
projects/apis/opengl/loader/opengl_commands_loader.c
Normal file
@@ -0,0 +1,8 @@
|
||||
#include "opengl_loader.h"
|
||||
#include "commands/buffers/opengl_command_buffer.h"
|
||||
|
||||
gnCommandFunctions loadOpenGLCommandFunctions() {
|
||||
return (gnCommandFunctions) {
|
||||
._gnCommandPoolAllocateCommandBuffers = openglCommandPoolAllocateCommandBuffers
|
||||
};
|
||||
}
|
@@ -4,6 +4,7 @@
|
||||
#include "shaders/opengl_shader_module.h"
|
||||
#include "renderpass/opengl_render_pass_descriptor.h"
|
||||
#include "uniforms/pool/opengl_uniform_pool.h"
|
||||
#include "commands/pool/opengl_command_pool.h"
|
||||
|
||||
gnDeviceFunctions loadOpenGLDeviceFunctions() {
|
||||
return (gnDeviceFunctions){
|
||||
@@ -23,8 +24,8 @@ gnDeviceFunctions loadOpenGLDeviceFunctions() {
|
||||
._gnCreateFramebuffer = NULL,
|
||||
._gnDestroyFramebuffer = NULL,
|
||||
|
||||
._gnCreateCommandPool = NULL,
|
||||
._gnDestroyCommandPool = NULL,
|
||||
._gnCreateCommandPool = openglCreateCommandPool,
|
||||
._gnDestroyCommandPool = openglDestroyCommandPool,
|
||||
|
||||
._gnCreateBuffer = NULL,
|
||||
._gnBufferData = NULL,
|
||||
|
@@ -0,0 +1,6 @@
|
||||
#include "opengl_command_buffer.h"
|
||||
|
||||
gnReturnCode openglCommandPoolAllocateCommandBuffers(gnCommandBufferHandle* commandBuffers, uint32_t count, gnCommandPoolHandle pool) {
|
||||
|
||||
return GN_SUCCESS;
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
#pragma once
|
||||
#include "core/src/command/command_buffer/gryphn_command_buffer.h"
|
||||
|
||||
typedef struct gnPlatformCommandBuffer_t {
|
||||
|
||||
} gnPlatformCommandBuffer;
|
||||
gnReturnCode openglCommandPoolAllocateCommandBuffers(gnCommandBufferHandle* commandBuffers, uint32_t count, gnCommandPoolHandle pool);
|
@@ -0,0 +1,6 @@
|
||||
#include "opengl_command_pool.h"
|
||||
|
||||
gnReturnCode openglCreateCommandPool(gnCommandPool commandPool, gnDevice device, gnCommandPoolInfo info) {
|
||||
return GN_SUCCESS;
|
||||
}
|
||||
void openglDestroyCommandPool(gnCommandPool commandPool) {}
|
@@ -0,0 +1,6 @@
|
||||
#pragma once
|
||||
#include "core/src/command/command_pool/gryphn_command_pool.h"
|
||||
|
||||
typedef struct gnPlatformCommandPool_t gnPlatformCommandPool;
|
||||
gnReturnCode openglCreateCommandPool(gnCommandPool commandPool, gnDevice device, gnCommandPoolInfo info);
|
||||
void openglDestroyCommandPool(gnCommandPool commandPool);
|
@@ -84,7 +84,9 @@ gnCommandFunctions loadAPICommandFunctions(gnRenderingAPI api) {
|
||||
case GN_RENDERINGAPI_SOFTWARE: return (gnCommandFunctions){ NULL };
|
||||
case GN_RENDERINGAPI_DIRECTX11: return (gnCommandFunctions){ NULL };
|
||||
case GN_RENDERINGAPI_DIRECTX12: return (gnCommandFunctions){ NULL };
|
||||
case GN_RENDERINGAPI_OPENGL: return (gnCommandFunctions){ NULL };
|
||||
#ifdef GN_API_OPENGL
|
||||
case GN_RENDERINGAPI_OPENGL: return loadOpenGLCommandFunctions();
|
||||
#endif
|
||||
#ifdef GN_API_METAL
|
||||
case GN_RENDERINGAPI_METAL: return loadMetalCommandFunctions();
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user