본문 바로가기
코드/C++

What does the GL_ARRAY_BUFFER target mean in glBindBuffer?

by bongin 2023. 8. 31.
728x90
반응형

https://stackoverflow.com/questions/14802854/what-does-the-gl-array-buffer-target-mean-in-glbindbuffer

 

What does the GL_ARRAY_BUFFER target mean in glBindBuffer?

I was confused about the VBO, glGenBuffers(1, &positionBufferObject); glBindBuffer(GL_ARRAY_BUFFER, positionBufferObject); Besides GL_ARRAY_BUFFER, there are other target types:

stackoverflow.com

 

Q.

What does the GL_ARRAY_BUFFER target mean in glBindBuffer?

I was confused about the VBO,

glGenBuffers(1, &positionBufferObject);
glBindBuffer(GL_ARRAY_BUFFER, positionBufferObject);
Besides GL_ARRAY_BUFFER, there are other target types: GL_ATOMIC_COUNTER_BUFFER, GL_COPY_READ_BUFFER...

However, the Opengl manual doesn't mention what these targets mean. I checked the glew.h:

#define GL_ARRAY_BUFFER 0x8892
Does this mean the targets (like GL_ARRAY_BUFFER) are addresses?

What does the target--GL_ARRAY_BUFFER mean in glBindBuffer?

 

 

 

A.

Most OpenGL objects must be bound to locations in the OpenGL context called "targets" for them to be used.
A target is nothing more than a place in the context where objects are bound.

Different object types (buffers, textures, etc) have different sets of targets.
Generally speaking, each target (≡position) has a specific meaning:
to bind / one object / to one target / means that you want to use that object in whatever manner that ( target uses objects / bound(≡binded) to it. )

Binding an object to one target does not affect / whether the object is bound to another target (unless it's a texture object; they treat targets differently).

There are functions that modify objects or query data from bound objects.
They take a target / to which the object ( they are modifying/querying ) has been bound.

The GL_ARRAY_BUFFER target for buffer objects / represents / the intent to use that buffer object for vertex attribute data.
However, binding to this target alone doesn't do anything.
it's only the call to glVertexAttribPointer (or equivalent functions) that uses whatever buffer was bound(≡binded) to that target for the attribute data for that attribute.
그 속성에 대한 속성 데이터에 대한 타겟(위치)에 바인드된 버퍼가 무엇이든,
glVertexAttribPointer를 호출하는 것이 유일한 방법이다.

728x90
반응형

'코드 > C++' 카테고리의 다른 글

깃헙 남의 게임 코드 실행  (0) 2023.10.01
참조자를 반환하는 함수  (0) 2023.09.19
how can Balmer find  (0) 2023.08.17
Texture.cpp  (1) 2023.07.29
OpenGL 환경설정  (0) 2023.07.24

댓글