Archived

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

glTextCord2f()?

This topic is 5588 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

I know that a thing like this had been answered in previous posts , but i cant make it work properly so i need to ask again.... I have a 800*800 Bitmap with tiles of 64*64 inside , i need get the coordinates of the tiles , but I can´t make it work , it always render a white square //Texture Coordinates TextPos[0] = 0.0f ; TextPos[1] = 0.0f; TextPos[2] = 0.08f ; TextPos[3] = 0.0f; TextPos[4] = 0.08f ; TextPos[5] = 0.08f; TextPos[6] = 0.0f ; TextPos[7] = 0.08f; [edited by - HPK on August 27, 2002 1:19:17 AM]

Share this post


Link to post
Share on other sites
Hmm.. you need to have an OpenGL rendering context before you load and bind textures, otherwise they will all be white. Can you see any other textures ok?

Share this post


Link to post
Share on other sites
you should have some problem with an 800*800 image.. do you upload that image as an texture? try a glGetError() after uploading the texture.

the texture coords are calculated as follow 1/texture_width*number_of_pixels_in_tile

/Mikael A

Share this post


Link to post
Share on other sites
sorry i didnt put all the code but OpenGl have a long initialization code, yes i checked again and everything is working because if i use 64*64 bitmap and i use the following coordinates teh texutre is displayed correctly, the problem is to take a smaller part of a bitmap...

//coords
0.0 0.0
1.0 0.0
1.0 1.0
0.0 1.0

Share this post


Link to post
Share on other sites