Skip to content

Commit 9580419

Browse files
committed
Merge pull request #171 from gaborpapp/texture-upload-fix
fixed OpenGLDepthPacketProcessor texture upload
2 parents ac5563b + 7110da7 commit 9580419

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

examples/protonect/src/opengl_depth_packet_processor.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,12 +278,15 @@ struct Texture : public WithOpenGLBindings
278278
bindToUnit(GL_TEXTURE0);
279279
glTexParameteri(GL_TEXTURE_RECTANGLE, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);
280280
glTexParameteri(GL_TEXTURE_RECTANGLE, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER);
281+
glTexParameteri(GL_TEXTURE_RECTANGLE, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
282+
glTexParameteri(GL_TEXTURE_RECTANGLE, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
281283
glTexImage2D(GL_TEXTURE_RECTANGLE, 0, FormatT::InternalFormat, width, height, 0, FormatT::Format, FormatT::Type, 0);
282284
}
283285

284286
void upload()
285287
{
286288
bindToUnit(GL_TEXTURE0);
289+
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
287290
glTexSubImage2D(GL_TEXTURE_RECTANGLE, /*level*/0, /*xoffset*/0, /*yoffset*/0, width, height, FormatT::Format, FormatT::Type, data);
288291
}
289292

0 commit comments

Comments
 (0)