Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 02-09-2010, 11:08 AM   #1 (permalink)
Johanovski
Divine avenger
 
Johanovski's Avatar
 
Join Date: Nov 2009
Location: Vic, Catalunya (Spain)
Posts: 320
Default Can't work with OpenGL and landscape...

Hi there!

After sending my first game to Apple (in review at this time!) it's time to begin with the second one! For this one I need to set OpenGL ES in landscape mode. I've started doing some game tests in a project in portrait mode but when I try to port this to landscape nothing work as it used to...
I know how to set landscape mode in the .plist file and also how to set OpenGL to draw in landscape mode:

Code:
glOrthof( -rect.size.width / 2, rect.size.width / 2, -rect.size.height / 2, rect.size.height / 2, -1, 1 );

(...)

glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(160.0f, 240.0f, 0.0f );
glRotatef(-90.0, 0.0, 0.0, 1.0);
glScalef(1.0, -1.0, 1.0);
Objects are now drawn in landscape mode as it was expected, but nothing's changed with this, so there's no axis inversion and objects didn't even seem to be where they're drawn (so for touching an object I must touch the screen zone where it used to be in portrait mode)... Is there any way of setting OpenGL in a landscape context and setting all with this (so no need to turn head to image how axis are going or where the object is, instead it's printed in other point? I'm getting quite mad with this... U_U'

Thanks in advance!

Last edited by Johanovski; 02-09-2010 at 11:14 AM.
Johanovski is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 158,866
Threads: 89,225
Posts: 380,691
Top Poster: BrianSlick (7,129)
Welcome to our newest member, sethaver
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 06:07 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.