Advertisement

OpenVR hellovr_opengl sample cant update texture on cube

Started by November 24, 2020 10:21 PM
1 comment, last by CommanderLake 4 years, 2 months ago

The hellovr_opengl sample is in the SDK here: https://github.com/ValveSoftware/openvr

I want to try something specific in VR with my Index starting with the OpenVR hellovr_opengl sample, I want to update the texture applied to the cube(s). I can change the initial texture but I can't get it to update in the main loop even using glTexSubImage2D in the RenderStereoTargets method, the image data, resolution and format are not in question, the data is valid, the texture just will not update!

I have this at the top of the RenderStereoTargets method:

glBindTexture(GL_TEXTURE_2D, m_iTexture);
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, image);
glBindTexture(GL_TEXTURE_2D, 0);

Sorry, just solved my own problem, I had the arguments mixed up and wasn't generating the mipmaps.

This topic is closed to new replies.

Advertisement