Fixed broken references: - texture-import-settings: Fix 16 files referencing wrong overview filename - math/rectint: Fix 9 method links (rectint-* → get*, contains, intersects) - rhi/opengl/device: Fix 8 cross-references (opengl-* → */**) - resources/mesh: Fix meshsection and vertexattribute links - rhi/d3d12/sampler: Fix RHISampler reference path - math/vector3: Fix projectonplane → project-on-plane - rhi/opengl/command-list: Remove broken ClearFlag enum ref - rhi/opengl/device: Create 2 new method docs (MakeContextCurrent, GetNativeContext) - rhi/device: Fix device-info types reference All 0 broken references remaining.
29 lines
569 B
Markdown
29 lines
569 B
Markdown
# OpenGLSwapChain::Initialize
|
|
|
|
使用已存在的窗口初始化 OpenGL 交换链。
|
|
|
|
```cpp
|
|
bool Initialize(OpenGLDevice* device, HWND window, int width, int height);
|
|
```
|
|
|
|
**参数:**
|
|
- `device` - OpenGL 设备指针
|
|
- `window` - Win32 窗口句柄
|
|
- `width` - 窗口宽度
|
|
- `height` - 窗口高度
|
|
|
|
**返回:** 成功初始化返回 true
|
|
|
|
**示例:**
|
|
|
|
```cpp
|
|
OpenGLDevice device;
|
|
device.Initialize({});
|
|
OpenGLSwapChain swapChain;
|
|
swapChain.Initialize(&device, hwnd, 1280, 720);
|
|
```
|
|
|
|
## 相关文档
|
|
|
|
- [OpenGLSwapChain 总览](swap-chain.md) - 返回类总览
|