Archived

This topic is now archived and is closed to further replies.

using pixels instead of floats for OGL

This topic is 5317 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

to use the msrment in pixels instead of a float I use i instead of f, right?, so this should work, but it doesn''t: NOTE: tileX = 1, tileY = 1, tilesize = 32. I am trying to get hte bottom left tile, instead i get the whole image looped.
  

	glBegin(GL_QUADS);
		glTexCoord2i(tilesize*tileX-tilesize,tilesize*tileY-tilesize);
		glVertex2f(0,0);
		glTexCoord2i(tilesize*tileX,tilesize*tileY-tilesize);
		glVertex2f(1,0);
		glTexCoord2i(tilesize*tileX,tilesize*tileY);
		glVertex2f(1,1);
		glTexCoord2i(tilesize*tileX-tilesize,tilesize*tileY);
		glVertex2f(0,1);
	glEnd();  
  
yes, me = noob thanks for all the people with the patience ot help

Share this post


Link to post
Share on other sites
oh so that isn't how to speify it as pixels, how can I though, not too comfortable with 0-1 type stuff

EDIT:: nm i was tryinjg to do this to get around a problem but i figured it out. i couldve defined a pixel as 1/512 though and used float (the big pic is 512px)

[edited by - PlagueViper on May 28, 2003 7:10:37 PM]

Share this post


Link to post
Share on other sites