0

Can I increase the frame of EAGLView(I am setting CGRectMake(0,0,320*3,480*3) above 1024, If i set frame above 1024 it works correctly in iOS 4.2 but in iOS 4.1 devices its not working if i set frame above 1024.

DO i need to add any extra code for 4.1? 
Why the textures are not displaying in IOS 4.1 devices if i set the frame of EAGLView above 1024?

UPDATED: I created a sample openGL project and i replaced didFinishLaunchingWithOptions with following code.... It works well in simulator but It is not displaying anything on devices < IOS 4.2.

#define VIEWSIZEFACTOR 3 // our EAGLView nees to be multiple of 320X480 to maintain aspect ratio.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    CGRect rect = [[UIScreen mainScreen] bounds];
    [self.viewController.view setFrame:CGRectMake(-500, -500, rect.size.width*VIEWSIZEFACTOR, rect.size.height*VIEWSIZEFACTOR)]; //CHANGESIZE

    [self.window addSubview:self.viewController.view];
    return YES;
}
Chandan Shetty SP
  • 5,087
  • 6
  • 42
  • 63

1 Answers1

2

Could it be that the iOS 4.2 device is a more recent one than the iOS 4.1 device? More modern devices (iPhone 3GS & 4, iPad, newer iPod Touch) use a more advanced GPU which supports the OpenGL ES2.0 pipeline and larger textures (2048x2048).

Vagrant
  • 1,696
  • 12
  • 19
  • p.s. Why would you ever need a GL viewport larger than 1024 (the size of the iPad)? Couldn't you do any scrolling in OpenGL instead of doing all the GPU work of drawing a huge rendering which is only partially visible? – Vagrant Dec 01 '10 at 07:08
  • I am new to openGL so i used scroll view. – Chandan Shetty SP Dec 01 '10 at 07:11
  • And the device is iPhone3G with 4.1(it is giving problem) and it is working well in iPod3G with 4.2. – Chandan Shetty SP Dec 01 '10 at 07:15
  • Yep, the iPod 3G uses the same GPU as the iPhone3GS. They do OpenGLES2.0 (programmable pipeline). The iPhone 3G uses the old GPU with the OpenGLES1.0 fixed pipeline). – Vagrant Dec 01 '10 at 07:41
  • So, This is a hardware issue, not an OS issue. Upgrading the iPhone3G to iOS 4.2 will not fix the problem. – Vagrant Dec 01 '10 at 07:42
  • If you must use textures larger than 1024, then you can put a restriction on you app that it need OpenGL ES 2.0. – Vagrant Dec 01 '10 at 07:43
  • Similarly, if you can find a way to get the simulator to run iOS4.1, it will still work fine with textures over 1024, since your development machine seems to have a GPU that can handle it. – Vagrant Dec 01 '10 at 07:45
  • Any other way to fix this... Without reducing size of EAGLView. – Chandan Shetty SP Dec 01 '10 at 08:30
  • You could do your own tiling. Draw four quads instead of just one, and make each quad use a smaller texture (a portion of the whole image). Or you could use a smaller, lower-res texture file and scale it to the viewport size (texture mapping). – Vagrant Dec 01 '10 at 08:36
  • Or you could not use OpenGL at all. Use UIImageView instead? OpenGL is meant for low-level programming and you should expect to run into these sorts of problems if you use it. – Vagrant Dec 01 '10 at 08:37
  • http://developer.apple.com/library/ios/#documentation/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/OpenGLESPlatforms/OpenGLESPlatforms.html Limitations of OpenGL ES – Chandan Shetty SP Dec 01 '10 at 13:23