glfwGetPrimaryMonitor 返回 0 [英] glfwGetPrimaryMonitor is returning 0

查看:28
本文介绍了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 中的一个错误,尚未在任何稳定版本中修复(交换使用最新的每晚 libs 而没有采取任何其他行动为我解决了这个问题 - 所以这肯定是最终导致这种情况的原因)

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天全站免登陆