write the functions for the command pool/buffers

This commit is contained in:
Gregory Wells
2025-08-12 23:09:39 -04:00
parent f251613d77
commit d48332fdcd
7 changed files with 39 additions and 3 deletions

View File

@@ -0,0 +1,8 @@
#include "opengl_loader.h"
#include "commands/buffers/opengl_command_buffer.h"
gnCommandFunctions loadOpenGLCommandFunctions() {
return (gnCommandFunctions) {
._gnCommandPoolAllocateCommandBuffers = openglCommandPoolAllocateCommandBuffers
};
}

View File

@@ -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,

View File

@@ -0,0 +1,6 @@
#include "opengl_command_buffer.h"
gnReturnCode openglCommandPoolAllocateCommandBuffers(gnCommandBufferHandle* commandBuffers, uint32_t count, gnCommandPoolHandle pool) {
return GN_SUCCESS;
}

View File

@@ -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);

View File

@@ -0,0 +1,6 @@
#include "opengl_command_pool.h"
gnReturnCode openglCreateCommandPool(gnCommandPool commandPool, gnDevice device, gnCommandPoolInfo info) {
return GN_SUCCESS;
}
void openglDestroyCommandPool(gnCommandPool commandPool) {}

View File

@@ -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);

View File

@@ -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