mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 17:35:45 +02:00
Fix for enabling depth-only webcam after startup.
This commit is contained in:
parent
377adb30ae
commit
80481747fa
1 changed files with 4 additions and 4 deletions
|
@ -168,8 +168,8 @@ void Webcam::setFrame(const Mat& color, int format, const Mat& depth, float midF
|
||||||
if (_colorTextureID == 0) {
|
if (_colorTextureID == 0) {
|
||||||
glGenTextures(1, &_colorTextureID);
|
glGenTextures(1, &_colorTextureID);
|
||||||
glBindTexture(GL_TEXTURE_2D, _colorTextureID);
|
glBindTexture(GL_TEXTURE_2D, _colorTextureID);
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, _textureSize.width = colorImage.width, _textureSize.height = colorImage.height,
|
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, _textureSize.width = colorImage.width,
|
||||||
0, format, GL_UNSIGNED_BYTE, colorImage.imageData);
|
_textureSize.height = colorImage.height, 0, format, GL_UNSIGNED_BYTE, colorImage.imageData);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -195,8 +195,8 @@ void Webcam::setFrame(const Mat& color, int format, const Mat& depth, float midF
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
glBindTexture(GL_TEXTURE_2D, _depthTextureID);
|
glBindTexture(GL_TEXTURE_2D, _depthTextureID);
|
||||||
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, _textureSize.width, _textureSize.height, GL_LUMINANCE,
|
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, _textureSize.width = depthImage.width,
|
||||||
GL_UNSIGNED_BYTE, depthImage.imageData);
|
_textureSize.height = depthImage.height, GL_LUMINANCE, GL_UNSIGNED_BYTE, depthImage.imageData);
|
||||||
}
|
}
|
||||||
} else if (_depthTextureID != 0) {
|
} else if (_depthTextureID != 0) {
|
||||||
glDeleteTextures(1, &_depthTextureID);
|
glDeleteTextures(1, &_depthTextureID);
|
||||||
|
|
Loading…
Reference in a new issue