Support Forum       G3D Web Page     
Public Member Functions | Static Public Member Functions | List of all members
G3D::BufferTexture Class Reference


A 1D array stored on the GPU, backed by a buffer object. More...

Public Member Functions

 ~BufferTexture ()
 
shared_ptr< GLPixelTransferBufferbuffer ()
 The underlying OpenGL Pixel Buffer Object. More...
 
const ImageFormatformat () const
 
GLenum glslSamplerType () const
 The sampler type this type of data corresponds to... More...
 
unsigned int openGLID () const
 
unsigned int openGLTextureTarget () const
 
The OpenGL texture target this binds to (always GL_TEXTURE_BUFFER) More...
 
int size () const
 Number of pixels (underlying buffer width x height) More...
 
bool someTexelsInaccessible () const
 Returns true if the buffer associated with this texture has more texels than GL_MAX_TEXTURE_BUFFER_SIZE. More...
 

Static Public Member Functions

static shared_ptr< BufferTexturecreate (const String &name, const shared_ptr< GLPixelTransferBuffer > &buffer)
 

Detailed Description


A 1D array stored on the GPU, backed by a buffer object.

Commonly used as storage for GL Compute data.

Abstraction of OpenGL buffer textures. Buffer textures have a different size limit than normal 1D textures, have a special creation path, and are more or less special cases in every way. Instead of shoehorning them into G3D::Texture, we created this lightweight wrapper. This decision may be revisited in the near future, and the functionality rolled into G3D::Texture (or G3D::GLPixelTransferBuffer).

It is valid to create a buffer texture from a buffer with a larger number of texels than GL_MAX_TEXTURE_BUFFER_SIZE, but one can only access the first GL_MAX_TEXTURE_BUFFER_SIZE texels from the buffer texture. Use someTexelsInaccessible() to check if there are inaccessible texels in this object because of that.

Currently only allowed to be created from a GLPixelTransferBuffer... this will change in the near future

See also
G3D::Texture

Constructor & Destructor Documentation

◆ ~BufferTexture()

G3D::BufferTexture::~BufferTexture ( )

Member Function Documentation

◆ buffer()

shared_ptr<GLPixelTransferBuffer> G3D::BufferTexture::buffer ( )
inline

The underlying OpenGL Pixel Buffer Object.

◆ create()

static shared_ptr<BufferTexture> G3D::BufferTexture::create ( const String name,
const shared_ptr< GLPixelTransferBuffer > &  buffer 
)
static

◆ format()

const ImageFormat* G3D::BufferTexture::format ( ) const

◆ glslSamplerType()

GLenum G3D::BufferTexture::glslSamplerType ( ) const

The sampler type this type of data corresponds to...

used for binding to shaders

◆ openGLID()

unsigned int G3D::BufferTexture::openGLID ( ) const
inline

◆ openGLTextureTarget()

unsigned int G3D::BufferTexture::openGLTextureTarget ( ) const


The OpenGL texture target this binds to (always GL_TEXTURE_BUFFER)

◆ size()

int G3D::BufferTexture::size ( ) const

Number of pixels (underlying buffer width x height)

◆ someTexelsInaccessible()

bool G3D::BufferTexture::someTexelsInaccessible ( ) const

Returns true if the buffer associated with this texture has more texels than GL_MAX_TEXTURE_BUFFER_SIZE.

This is valid, but the texels out of this range will be inaccessible in shaders.


documentation generated on Wed Nov 24 2021 08:01:53 using doxygen 1.8.15