EAGLView 中的限制
我可以增加 EAGLView 的框架吗(我将 CGRectMake(0,0,320*3,480*3) 设置为高于 1024,如果我将框架设置为高于 1024,则它在 iOS 4.2 中可以正常工作,但在 iOS 4.1 设备中,如果我将框架设置为高于 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?
:我创建了一个示例 openGL 项目,并用以下代码替换了 didFinishLaunchingWithOptions...它在模拟器中运行良好,但在 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;
}
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;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
难道 iOS 4.2 设备比 iOS 4.1 设备更新吗?更现代的设备(iPhone 3GS 和 4、iPad、较新的 iPod Touch)使用更先进的 GPU,支持 OpenGL ES2.0 管道和更大的纹理 (2048x2048)。
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).