Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

glClearBufferData - Usage Example?

Tags:

c++

opengl

void glClearBufferData(GLenum target, GLenum internalformat, GLenum format, 
      GLenum type, const void* data);

I'm not quite sure how to use this method properly. More specifically the internalformat and format parameters. The official documentation is very vague about what these are, and I'm having trouble finding a list of available targets for these. Are these set targets, or do I need to just to pass a size for the data or something? I also couldn't find any usage examples of this function online... could anyone provide me with one, or perhaps a list of targets?

like image 394
Shokwav Avatar asked May 09 '13 13:05

Shokwav


1 Answers

  • target is the target to which the destination buffer is bound.
  • internalFormat must be set to one of the format tokens given by openGL
  • format and type specify the format and type of the source data.
  • data is the converted data passed to the buffer

Reference: http://www.opengl.org/registry/specs/ARB/clear_buffer_object.txt

You can find a list of some internal formats here: http://www.opengl.org/sdk/docs/man/xhtml/glTexImage2D.xml

though i cannot seem to find table 3.15 that the text references.

EXAMPLE: enter image description here

You can find this article here

like image 108
Syntactic Fructose Avatar answered Sep 25 '22 23:09

Syntactic Fructose