Sub-Texture coordinates


I have a texture with the size 1024x1024. I’m trying to get a part of it on the screen with the exact size.

The part has the coordiantes (0,0)x(256,256).

So the texture coordinates are supossed to be:

The screen coordinates are:

The problem is that the last vertical and horizontal line of the texture is missing on the screen.

I tried it all day long and I’m really stuck…


why don’t u simply try (0,0) and (255,255)?

Doesn’t it work?


Note that 255.5 - 0.5 = 255.0, and you need 256 pixels to be visible. You simply have your quad too small by one pixel.