fix(RHI): 添加 OpenGL 源文件到 CMakeLists 并修复编译错误

- 添加 OpenGL RHI 所有源文件到 engine/CMakeLists.txt
- 修复 OpenGLPipelineState 结构体重定义问题
- 修复 BufferDesc/TextureDesc/ShaderCompileDesc API 不匹配
- 添加 OpenGLShader 缺少的基类纯虚函数实现
- 修复 HashMap 迭代器支持和 ResourceManager API 调用
This commit is contained in:
2026-03-18 03:37:34 +08:00
parent 8344057886
commit 3196261e9b
8 changed files with 90 additions and 31 deletions

View File

@@ -202,6 +202,19 @@ bool OpenGLShader::Compile(const char* source, ShaderType type) {
return true;
}
bool OpenGLShader::CompileFromFile(const wchar_t* filePath, const char* entryPoint, const char* target) {
std::wstring ws(filePath);
std::string path(ws.begin(), ws.end());
return CompileFromFile(path.c_str(), nullptr);
}
bool OpenGLShader::Compile(const void* sourceData, size_t sourceSize, const char* entryPoint, const char* target) {
if (!sourceData || sourceSize == 0) {
return false;
}
return Compile(static_cast<const char*>(sourceData), ShaderType::Fragment);
}
void OpenGLShader::Shutdown() {
if (m_program) {
glDeleteProgram(m_program);