在 Open GL ES 视图上覆盖标签

发布于 2024-12-23 12:31:20 字数 714 浏览 4 评论 0原文

我试图在我的 Open GL ES 视图上覆盖一个标签(以及将来的 UI 图像),但什么也没有看到,知道为什么吗?用户交互和多点触控已勾选。我很确定它与此 applicationDidFinishLaunching 调用有关,但不确定它可能是什么:

- (void)applicationDidFinishLaunching:(UIApplication*)application
 {
CGRect  rect = [[UIScreen mainScreen] bounds];

GLViewController *theController = [[GLViewController alloc] init];
self.controller = theController;
[theController release];

GLView *glView = [[GLView alloc] initWithFrame:rect];
[window addSubview:glView];

glView.controller = controller;
glView.animationInterval = 1.0 / kRenderingFrequency;
[glView startAnimation];
[glView release];

[window makeKeyAndVisible];

 }

在此处输入图像描述

Im trying to overlay a Label (and in the future a UI Image) over my Open GL ES View but nothing is being seen, any idea why? User Interaction and Multi Touch are checked off. Im pretty sure it has something to do with this applicationDidFinishLaunching call but not sure what it could be:

- (void)applicationDidFinishLaunching:(UIApplication*)application
 {
CGRect  rect = [[UIScreen mainScreen] bounds];

GLViewController *theController = [[GLViewController alloc] init];
self.controller = theController;
[theController release];

GLView *glView = [[GLView alloc] initWithFrame:rect];
[window addSubview:glView];

glView.controller = controller;
glView.animationInterval = 1.0 / kRenderingFrequency;
[glView startAnimation];
[glView release];

[window makeKeyAndVisible];

 }

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

羅雙樹 2024-12-30 12:31:20

您对 addSubview: 的调用将 GLView 实例置于层次结构中任何其他视图的前面。请使用 insertSubview: 方法之一,或者将 GLView 添加到窗口后将其发送到后面。

Your call to addSubview: puts the GLView instance in front of any other views in the hierarchy. Use one of the insertSubview: methods instead or send your GLView to the back after adding it to the window.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文