actually compile shaders

This commit is contained in:
Gregory Wells
2025-08-12 22:17:54 -04:00
parent f6484ddde5
commit 23f46385fe
5 changed files with 66 additions and 5 deletions

View File

@@ -1,9 +1,17 @@
#include "opengl_shader_module.h"
// #include "stdio.h"
#include "opengl_shader_compiler.h"
#include "stdlib.h"
gnReturnCode openglCreateShaderModule(gnShaderModule module, gnDevice device, gnShaderModuleInfo shaderModuleInfo) {
module->shaderModule = malloc(sizeof(gnPlatformShaderModule));
glCompilerInfo info = {
.code = shaderModuleInfo.code,
.wordCount = shaderModuleInfo.size / 4,
.entryPoint = gnToCString(shaderModuleInfo.entryPoint),
};
module->shaderModule->compiler = glCreateCompiler(&info);
return GN_SUCCESS;
}
void openglDestroyShaderModule(gnShaderModule module) {
free(module->shaderModule);
}