Skip to content

Commit

Permalink
讨论 glVertexPointer 和 glVertexAttribPointer
Browse files Browse the repository at this point in the history
  • Loading branch information
chuigda committed Jul 29, 2023
1 parent 8fee2ca commit 81eafb1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions markdown/10mins-computer-graphics-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ glBufferData(GL_ARRAY_BUFFER, sizeof(positionArray), positionArray, GL_STATIC_DR
glBindBuffer(GL_ARRAY_BUFFER, bufferId); // 选择要操作的缓冲区
glVertexPointer(2, GL_FLOAT, 0, 0); // 给原先传指针的参数传 0 (空指针),表示从缓冲区中读取数据
glDrawArrays(GL_TRIANGLES, 0, 3); // 直接调用之前存储在 GPU 上的数据进行绘制

// 在可编程管线中,使用 glVertexAttribPointer 代替 glVertexPointer,其他类似
```
### 顶点数组对象
Expand Down

0 comments on commit 81eafb1

Please sign in to comment.