draw ofGrabber frame with normalized tex coords

Just testing some things and after calling ofEnableNormalizedTexCoords() I still can’t get a frame from a video drawn with normalized tex coords, i.e.

  
glTexCoord2f(0, 0);glVertex2f(0, 0);  
	glTexCoord2f(1, 0);glVertex2f(640, 0);  
	glTexCoord2f(1, 1);glVertex2f(640, 480);  
	glTexCoord2f(0, 1);glVertex2f(0, 480);  

I always have to use:

  
glTexCoord2f(0, 0);glVertex2f(0, 0);  
	glTexCoord2f(320, 0);glVertex2f(640, 0);  
	glTexCoord2f(320, 240);glVertex2f(640, 480);  
	glTexCoord2f(0, 240);glVertex2f(0, 480);  

I know the quicktime textures are a little odd, but does anyone know a simple way to get them drawn with normalized coords? Just curious if it’s something that requires a lot of non-OF-intuitive type stuff.

note that ofEnableNormalizedTexCoords() just switches a flag inside OF (bUsingNormalizedTexCoords) it doesn’t actually “do” anything to opengl.

that flag is accessed via ofGetUsingNormalizedTexCoords() which is only called inside ofTexture during bind() / unbind().

can you post a little more code? if you’re not using bind()/unbind() then it won’t work.

Thanks for pointing me in the right direction. Ah the joys of half-awake coding :slight_smile: I see the problem and it has nothing to do with ofVideoGrabber.

ofTex bind() checks ofGetUsingNormalizedTexCoords() and changes texture matrix stack, but I’m using ofShader setUniformTexture() which doesn’t. It makes sense that setUniformTexture() doesn’t check, but I assumed it was calling ofTex bind().