glfwGetPrimaryMonitor返回0 [英] glfwGetPrimaryMonitor is returning 0

查看:115
本文介绍了glfwGetPrimaryMonitor返回0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我打电话

long rslt = glfwGetPrimaryMonitor();

结果为0.由于某些未知原因,glfw库无法接收我的监视器.另外,如果我尝试:

the result is 0. The glfw library can't pick up my monitors for some unknown reason. Also, if I try:

PointerBuffer rslt = glfwGetMonitors();

结果为空... 我的显示器工作正常.我已经看到一些建议,我应该卸载显示器并让Windows重新安装适当的驱动程序.对我来说这似乎是一个不足的解决方法.我不能指望用户如果运行我的应用程序就必须这样做.我更希望至少获得一些我可以用来指示问题的错误代码.有没有人有这方面的经验?有没有办法检索有用的错误?

the result is null... My monitors work fine. I have seen some suggestions that I should uninstall my monitors and let windows reinstall the appropriate drivers. This seems like an inadequate workaround to me. I can't expect users to have to do this if they run my application. I'd much prefer to at least get some error code that I could use to indicate the problem. Has anyone had any experience with this? Is there a way to retrieve a helpful error?

我正在运行Windows 10,lwjgl3,glfw(最新的稳定版本)

I am running windows 10, lwjgl3, glfw(latest stable build)

推荐答案

您是说要重新安装显示器驱动程序才能使其正常工作吗?

Do you mean to say you had to re-install your monitor drivers to get it to work?

我陷入了同样的问题.调用glfwGetPrimaryMonitor();从主线程返回0,也没有收到任何错误消息...

I'm stuck in the same problem. Calling glfwGetPrimaryMonitor(); from main thread, returns 0, not getting any error messages either...

修改: 请注意当前正在解决此问题的任何人:我建议获取lwjgl的最新夜间版本,因为这是lwjgl 3.0中的错误,尚未在任何稳定的版本中得到解决(交换每晚执行最新操作的lib却不采取任何其他措施为我解决了这个问题-因此,这肯定是最终导致此问题的原因

Note to anyone who currently struggles with this problem: I recommend getting the newest nightly build of lwjgl as this is a bug in lwjgl 3.0 that hasn't been fixed in any of the stable builds yet (swapping the libs with the newest nightly without taking any other actions solved the problem for me - so this sure is what ultimately caused this)

这篇关于glfwGetPrimaryMonitor返回0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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