So I am trying to render my program in landscape mode... however I am coming across something that I am having trouble wrapping my mind around. In order to move down on my map I have to have a negative offset. If I keep the current positive yOffset of 100 then the map scrolls down instead of up. Why is this? I'm not happy having to put negative y coords to see the map. Is there a way I can reverse this so the map scrolls in the opposite direction when yOffset is positive?
float yOffset = 100;
float xOffset = 0;
glOrthof(0 - yOffset,
320 - yOffset,
480 + xOffset,
0 + xOffset,
-10000.0f,10000.0f);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(320.0f, 0.0f, 0.0f );
glRotatef(90.0, 0.0, 0.0, 1.0);
static const GLfloat squareVertices[] = {
0.0f, 0.0f,
1024.0f, 0.0f,
0.0f, 1024.0f,
1024.0f, 1024.0f
};
static const GLfloat texCoords[] = {
0.0, 1.0,
1.0, 1.0,
0.0, 0.0,
1.0, 0.0
};
glEnable(GL_BLEND);
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_TEXTURE_2D);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glTexCoordPointer(2, GL_FLOAT, 0, texCoords);
glVertexPointer(2, GL_FLOAT, 0, squareVertices);
glBindTexture(GL_TEXTURE_2D, mapTexture);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisable(GL_TEXTURE_2D);
glDisable(GL_BLEND);