Integer texture coordinates.

Sage
Posts: 1,482
Joined: 2002.09
Post: #1
So according to the red book, the coordinates passed to glTexCoord2i() are interpreted instead of being clamped. I seem remember using this before in a simple 2D program that I did before, but now when I use it, it just seems to act as a floating point value. What gives? Am I forgetting to enable some magic state?
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
buh?

int x, y;
glTexCoord2i(x, y) is equivalent to glTexCoord2f(x, y)
Quote this message in a reply
Puzzler183
Unregistered
 
Post: #3
The only time coordinates aren't treated on [0, 1] (wrapped there or clamped) is for rectangular textures (AFAIK).
Quote this message in a reply
Sage
Posts: 1,232
Joined: 2002.10
Post: #4
The TEXTURE_WRAP state affects how coordinates outside [0, 1] are interpreted. For example with MIRROR_CLAMP, coordinates in the [1, 2] range and >2 will be different.
Quote this message in a reply
Sage
Posts: 1,482
Joined: 2002.09
Post: #5
The Red Books description of glTexCoord*()
Quote:...
Note that integer texture coordinates are interpreted directly instead of being mapped to the range [-1, 1] as normal coordinates are.


What does that mean then? I could swear that I'd used that before to specify coordinates like you would for rectangle textures. Or, maybe I'm just remembering that I thought you could use them like that...

Anyway, is there any way to use texel aligned coordinates without messing with the texture matrix stack all the time?
Quote this message in a reply
Puzzler183
Unregistered
 
Post: #6
For the texel aligned stuff... Just don't worry about it. It shouldn't be causing any problems anyway (unless you have stuff bleeding into borders in which case there is an extension to fix that).
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  openal coordinates vs. opengl coordinates gerald 1 6,026 Feb 3, 2011 10:04 PM
Last Post: OneSadCookie
  vertex/texture coordinates screwy reubert 1 2,590 Aug 10, 2004 08:29 AM
Last Post: phydeaux
  Texture coordinates on trianglestrips designdb 7 4,686 May 22, 2003 09:34 AM
Last Post: designdb
  controlling automatically generated texture coordinates ghettotek 4 3,356 Feb 26, 2003 06:00 PM
Last Post: OneSadCookie
  Quicktime and Texture Coordinates Griggs 5 3,692 Sep 27, 2002 11:34 AM
Last Post: Griggs