Implement a small texture wrapper.
Allows for RAII use of OpenGL textures.
This commit is contained in:
@@ -49,18 +49,13 @@ MultiImageVisualisation::MultiImageVisualisation(const fmri::LayerData &layer)
|
||||
}
|
||||
}
|
||||
|
||||
MultiImageVisualisation::~MultiImageVisualisation()
|
||||
{
|
||||
glDeleteTextures(0, &texture);
|
||||
}
|
||||
|
||||
void MultiImageVisualisation::render()
|
||||
{
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
||||
glBindTexture(GL_TEXTURE_2D, texture);
|
||||
texture.bind(GL_TEXTURE_2D);
|
||||
glTexCoordPointer(2, GL_FLOAT, 0, texCoordBuffer.get());
|
||||
glVertexPointer(3, GL_FLOAT, 0, vertexBuffer.get());
|
||||
glDrawArrays(GL_QUADS, 0, nodePositions_.size() / 3 * 4);
|
||||
|
||||
Reference in New Issue
Block a user