| First I create a window containing a 512 x 480 NSOpenGLView.
Othographic projection is set up: glMatrixMode(GL_PROJECTION); glLoadIdentity(); glViewport(0, 0, 512, 480); gluOrtho2D(0, 512, 480, 0);Then a single 512 x 480 rectangle texture is drawn: glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glEnable(GL_TEXTURE_RECTANGLE_EXT); glBindTexture(GL_TEXTURE_RECTANGLE_EXT, texture[0]); glBegin(GL_QUADS); glTexCoord2i(0, 0); glVertex2i (0, 0); glTexCoord2i(512, 0); glVertex2i (512, 0); glTexCoord2i(512, 480); glVertex2i (512, 480); glTexCoord2i(0, 480); glVertex2i (0, 480); glEnd();Here is the result: |
![]() |
If you look closely (use Pixie, or zoom in via Universal Access, turning off "Smooth Images"), you will notice that the texels gradually lose alignment with the pixels, the farther away from the origin they are. The upper left corner looks correct. |
| The lower right corner is not exactly aligned. What am I doing wrong? |
![]() |
| The Apple sample code has the same problem: | |
![]() |
![]() |
| Here is a bitmap displayed in the Finder. No problems. |
Same bitmap in OpenGL Image. Same blurring problem as above. |