docs: update resources API docs
This commit is contained in:
35
docs/api/resources/shader/setsourcecode.md
Normal file
35
docs/api/resources/shader/setsourcecode.md
Normal file
@@ -0,0 +1,35 @@
|
||||
# Shader::SetSourceCode
|
||||
|
||||
```cpp
|
||||
void SetSourceCode(const Containers::String& source)
|
||||
```
|
||||
|
||||
设置着色器源码。
|
||||
|
||||
**参数:**
|
||||
- `source` - 着色器源码字符串
|
||||
|
||||
**返回:** 无
|
||||
|
||||
**线程安全:** ❌ 非线程安全
|
||||
|
||||
**复杂度:** O(n) - 复制源码字符串
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
Shader vs;
|
||||
vs.SetShaderType(ShaderType::Vertex);
|
||||
vs.SetShaderLanguage(ShaderLanguage::GLSL);
|
||||
vs.SetSourceCode(R"(
|
||||
#version 450
|
||||
layout(location = 0) in vec3 aPosition;
|
||||
void main() {
|
||||
gl_Position = vec4(aPosition, 1.0);
|
||||
}
|
||||
)");
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [Shader 总览](shader.md) - 返回类总览
|
||||
Reference in New Issue
Block a user