fix: improve doc link navigation and tree display
- Fix link resolution with proper relative/absolute path handling - Improve link styling with underline decoration - Hide leaf nodes from tree, only show directories - Fix log file path for packaged app
This commit is contained in:
34
docs/api/rhi/opengl/shader/compile-vs-fs.md
Normal file
34
docs/api/rhi/opengl/shader/compile-vs-fs.md
Normal file
@@ -0,0 +1,34 @@
|
||||
# OpenGLShader::Compile (VS+FS)
|
||||
|
||||
```cpp
|
||||
bool Compile(const char* vertexSource, const char* fragmentSource);
|
||||
```
|
||||
|
||||
从源代码编译顶点着色器和片段着色器。
|
||||
|
||||
**参数:**
|
||||
- `vertexSource` - 顶点着色器源代码
|
||||
- `fragmentSource` - 片段着色器源代码
|
||||
|
||||
**返回:** 成功返回 `true`,失败返回 `false`
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
const char* vs = R"(
|
||||
#version 330 core
|
||||
void main() { gl_Position = vec4(0.0); }
|
||||
)";
|
||||
const char* fs = R"(
|
||||
#version 330 core
|
||||
out vec4 color;
|
||||
void main() { color = vec4(1.0); }
|
||||
)";
|
||||
shader->Compile(vs, fs);
|
||||
shader->Use();
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [OpenGLShader 总览](shader.md) - 返回类总览
|
||||
- [CompileCompute](compile-compute.md) - 计算着色器版本
|
||||
Reference in New Issue
Block a user