Files
XCEngine/docs/api/rhi/opengl/buffer/initialize.md

27 lines
560 B
Markdown
Raw Normal View History

# OpenGLBuffer::Initialize
```cpp
bool Initialize(OpenGLBufferType type, size_t size, const void* data = nullptr, bool dynamic = false);
```
初始化 OpenGL 缓冲区。
**参数:**
- `type` - 缓冲区类型
- `size` - 缓冲区大小(字节)
- `data` - 初始数据指针(可选)
- `dynamic` - 是否为动态缓冲区
**返回:** 成功返回 true
**示例:**
```cpp
OpenGLBuffer buffer;
buffer.Initialize(OpenGLBufferType::Vertex, sizeof(vertices), vertices);
```
## 相关文档
- [OpenGLBuffer 总览](buffer.md) - 返回类总览