Hello!
I'm using OpenGL to render things in my game, but I'm haveing some problems. OpenGL uses decimals/fractions between 0 and 1 to locate pixels in a given texture. (for example, if I want to locate the 8th pixel on the x-axis in an image that's 32 pixels wide, I would type 'x=8/32' instead of 'x=8')
The problem is that I can't put fractions into float variables, (which would be convenient in my code) I can only use decimals. I can't write 'float x = 8/32' because the result of 8/32 isn't 0.25, but when I write 'float x = 0.25' it works perfectly.
This is a snippet that demonstrates how I render:
I just wanted to ask this question before I start a suboptimal solution. Am I missing something or do I have to work around it? Am I using the wrong type of variables to store fractions? Is it the 'glTexCoord2f' function that's the problem?
Thanks.