Scale image in opengl

Hi
how to scale image? Below I try glScalef(0.3, 0.3, 0.3); without success.
Many thanks

    // bind textures on corresponding texture units
    glActiveTexture(GL_TEXTURE0);
    glBindTexture(GL_TEXTURE_2D, u_textureFg);
    glActiveTexture(GL_TEXTURE1);
    glScalef(0.3, 0.3, 0.3);
    glBindTexture(GL_TEXTURE_2D, u_textureBg);

    // render container
    ourShader.use();
    glBindVertexArray(VAO);
    glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_INT, 0);

If you’re using shaders, glScalef won’t do anything unless the shader references gl_ModelViewMatrix or similar. Most vertex shaders use a user-defined uniform variable for the transformation, so you’d need to modify that.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.