OpenGL3 how can I scale up a GL

The GL_TEXTURE_RECTANGLE displays itself in actual size (the resolution of the texture image), but I want to grow mine to fill the whole screen, regardless of which resolution is set.

When I change my texture coordinates and glTexImage2D() to use the screen resolution instead of the image size, I get ugly garbage on the screen. I'm wondering how I can make the image fill the whole screen without having to make a separately-sized image file for every possible screen resolution.


You don't change the texture coordinates; you change the vertex coordinates. Either by changing the matrix you're using to render, or by changing the positions of the vertices.

You could just use no matrices at all to transform the positions of your quad. In this case, the positions would just be (-1, -1), (-1, 1), (1, 1), (1, -1). And that will work for any screen resolution (assuming you set up the viewport correctly).

链接地址: http://www.djcxy.com/p/38492.html

上一篇: 在opengl3中的立方体纹理

下一篇: OpenGL3如何扩展GL