const LayerGL* ImageGL::getLayerGL(LayerType type, size_t idx) const { switch (type) { case LayerType::Color: return getColorLayerGL(idx); case LayerType::Depth: return getDepthLayerGL(); case LayerType::Picking: return getPickingLayerGL(); } return nullptr; }
void unbindTextures(const Image& image, bool color, bool depth, bool picking) { auto imageGL = image.getRepresentation<ImageGL>(); if (color) { const LayerGL* layer = imageGL->getColorLayerGL(); if (layer) { layer->unbindTexture(); } } if (depth) { const LayerGL* layer = imageGL->getDepthLayerGL(); if (layer) { layer->unbindTexture(); } } if (picking) { const LayerGL* layer = imageGL->getPickingLayerGL(); if (layer) { layer->unbindTexture(); } } }
void bindTextures(const Image& image, bool color, bool depth, bool picking, GLenum colorTexUnit, GLenum depthTexUnit, GLenum pickingTexUnit) { auto imageGL = image.getRepresentation<ImageGL>(); if (color) { const LayerGL* layer = imageGL->getColorLayerGL(); if (layer) { layer->bindTexture(colorTexUnit); } } if (depth) { const LayerGL* layer = imageGL->getDepthLayerGL(); if (layer) { layer->bindTexture(depthTexUnit); } } if (picking) { const LayerGL* layer = imageGL->getPickingLayerGL(); if (layer) { layer->bindTexture(pickingTexUnit); } } }