My texture size is 3840 x 540, composition window size is 1920 x 1080
With the current code i can move the texture only in the 3840 x 540 tex coordinates.
How would i go around so i can move the texture in the composition window size
Code: Select all
DWORD H8_FFGLProWrap::DrawTex(ProcessOpenGLStruct* pGL)
{
//start out by just filling our output with the input texture
if (pGL->numInputTextures<1 || pGL->inputTextures[0]==NULL)
{
//no input? just clear
glClearColor(0.f,0.f,0.f,0.f);
glClear(GL_COLOR_BUFFER_BIT);
}
else
{
FFGLTextureStruct &Texture = *(pGL->inputTextures[0]);
//bind the texture handle
glBindTexture(GL_TEXTURE_2D, Texture.Handle);
//enable texturemapping
glEnable(GL_TEXTURE_2D);
//get the max s,t that correspond to the
//width,height of the used portion of the allocated texture space
FFGLTexCoords maxCoords = GetMaxGLTexCoords(Texture);
DrawTopTex(&maxCoords);
//unbind the texture
glBindTexture(GL_TEXTURE_2D, 0);
//disable texturemapping
glDisable(GL_TEXTURE_2D);
}
return FF_SUCCESS;
}
void H8_FFGLProWrap::DrawTopTex(FFGLTexCoords *maxCoords)
{
glTranslatef(-0.5f, 0.0f, 0.0f);
//loop to clone the texture
glPushMatrix();
glBegin(GL_QUADS);
//lower left
glTexCoord2d(0.0, 0.0);
glVertex2f(-1,-1);
//upper left
glTexCoord2d(0.0, maxCoords->t);
glVertex2f(-1,1);
//upper right
glTexCoord2d(maxCoords->s, maxCoords->t);
glVertex2f(1,1);
//lower right
glTexCoord2d(maxCoords->s, 0.0);
glVertex2f(1,-1);
glEnd();
glPopMatrix();
glLoadIdentity();
}