glTextCord2f()?
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]
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?
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
the texture coords are calculated as follow 1/texture_width*number_of_pixels_in_tile
/Mikael A
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
//coords
0.0 0.0
1.0 0.0
1.0 1.0
0.0 1.0
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement