在LWJGL中设置显示可见性 [英] Set Display visibility in LWJGL

查看:63
本文介绍了在LWJGL中设置显示可见性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在LWJGL 2中,是否可以设置显示可见性?类似于如何在 JFrame 上调用 setVisible 来显示或隐藏窗口.基本上,我想做的是使用Display.create()创建OpenGL上下文,然后在加载所有资源时显示一个加载初始屏幕(需要创建上下文),然后使显示可见.

In LWJGL 2, is there a way to set the display visibility? Similar to how you can call setVisible on a JFrame to show or hide the window. Basically what I want to do is create the OpenGL context using Display.create(), then show a loading splash screen while all my resources are loaded (requires context to be created) and then make the display visible.

推荐答案

您可以通过Display.setParent在创建的Canvas对象中创建显示父项.然后,对父母可见度的任何更改都会反映在显示对象中.

You could parent the display in a Canvas object you create, via Display.setParent. Then any changes to the parent's visibility will be reflected in the display object.

否则,您是否不能仅在上下文本身中创建启动画面,并仅在准备好之后切换要渲染的内容?

Otherwise couldn't you just make the splash screen in the context itself, and just switch what you're rendering when ready?

这篇关于在LWJGL中设置显示可见性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆