Commit b3fc236e authored by Martin Schultz's avatar Martin Schultz

fixes picking in compatibility profiles, when TextureBuffers are used.

Previous version of the code did not call glTextureBuffer in compat contexts.
However glSpec says glTextureBufferARB and glTextureBuffer are aliased, so it can be called as long as extension is available, or context is at least 3.1
parent 5d774d2b
...@@ -2072,7 +2072,7 @@ void DrawMeshT<Mesh>::updatePickingFaces_opt(ACG::GLState& _state ) ...@@ -2072,7 +2072,7 @@ void DrawMeshT<Mesh>::updatePickingFaces_opt(ACG::GLState& _state )
rebuild(); rebuild();
} }
if (!ACG::compatibilityProfile() && meshComp_ && meshComp_->getNumTriangles()) if (meshComp_ && meshComp_->getNumTriangles())
{ {
// upload tri->face lookup-table to texture buffer // upload tri->face lookup-table to texture buffer
pickFaceTriToFaceMapTBO_.setBufferData(sizeof(int) * meshComp_->getNumTriangles(), meshComp_->mapToOriginalFaceIDPtr(), GL_R32I, GL_STATIC_DRAW); pickFaceTriToFaceMapTBO_.setBufferData(sizeof(int) * meshComp_->getNumTriangles(), meshComp_->mapToOriginalFaceIDPtr(), GL_R32I, GL_STATIC_DRAW);
......
...@@ -794,8 +794,6 @@ TextureBuffer::~TextureBuffer() { ...@@ -794,8 +794,6 @@ TextureBuffer::~TextureBuffer() {
void TextureBuffer::setBufferData( void TextureBuffer::setBufferData(
size_t _size, const void* _data, GLenum _internalFormat, GLenum _usage) { size_t _size, const void* _data, GLenum _internalFormat, GLenum _usage) {
if(!ACG::compatibilityProfile())
{
if (supportsTextureBuffer()) { if (supportsTextureBuffer()) {
// setup buffer object // setup buffer object
if (!buffer_) if (!buffer_)
...@@ -819,9 +817,6 @@ if(!ACG::compatibilityProfile()) ...@@ -819,9 +817,6 @@ if(!ACG::compatibilityProfile())
} }
else else
std::cerr << "TextureBuffer::setData - gpu does not support buffer textures!" << std::endl; std::cerr << "TextureBuffer::setData - gpu does not support buffer textures!" << std::endl;
} else{
std::cerr << "TextureBuffer::setData - currently only in core profile available!" << std::endl;
}
} }
bool TextureBuffer::getBufferData(void* _dst) { bool TextureBuffer::getBufferData(void* _dst) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment