Commit 296459bf authored by Jan Möbius's avatar Jan Möbius

Merge branch 'fixCompatPicking' into 'master'

fixes picking in compatibility profiles, when TextureBuffers are used.

See merge request !75
parents 9a832d16 b3fc236e
...@@ -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