aspectRatio = backingWidth / backingHeight ???

Posted by carrots on Stack Overflow See other posts from Stack Overflow or by carrots
Published on 2010-06-08T08:37:06Z Indexed on 2010/06/08 8:42 UTC
Read the original article Hit count: 147

Filed under:
|
|

What am I doing wrong here, I can't get the result of this division:

aspectRatio = backingWidth / backingHeight;

I've thought I might try casting to (GLfloat) but that didn't do anything. As I step through the code I see that aspectRatio is 0 after the operation, while backingWidth is clearly 768 and backingHeight is 1029.

Here are the types:

GLfloat aspectRatio;

and

// The pixel dimensions of the CAEAGLLayer
GLint backingWidth;
GLint backingHeight;

It must be something basic I'm doing wrong here..

© Stack Overflow or respective owner

Related posts about iphone

Related posts about c