SDL_GetNumVideoDisplays() returns 1 当我有 2 个显示器时
SDL_GetNumVideoDisplays() returns 1 when I have 2 monitors
晚上好。
我正在远程计算机上设置游戏项目,运行遇到 SDL 问题。我正在使用 SDL 2.0,我想弄清楚为什么 SDL_GetNumVideoDisplays() returns 1 当我有 2 个显示器连接到我的 PC 时。我是 运行 Ubuntu 14.04 LTS,两台显示器似乎都配置正确,只是正常使用桌面。
希望获得有关在何处查找以解决此问题的提示。谢谢。
更新 1 - ./configure
用于 SDL2-2.0.4 源代码:
正在寻找配置脚本中对 X11 的一些提及并看到以下内容:
checking for X11/extensions/Xext.h... yes
-- dynamic libX11 -> libX11.so.6
-- dynamic libX11ext -> libXext.so.6
checking for const parameter to XextAddDisplay... yes
checking for XGenericEvent... yes
checking for XkbKeycodeToKeysym in -lX11... yes
checking for X11/Xcursor/Xcursor.h... no
checking for X11/extensions/Xdbe.h... yes
checking for X11/extensions/Xinerama.h... no
checking for X11/extensions/XInput2.h... no
checking for X11/extensions/scrnsaver.h... no
checking for X11/extensions/shape.h... yes
checking for X11/extensions/xf86vmode.h... yes
和
X11 libraries : xdbe xshape xvidmode
我的xrandr --version
是:
xrandr program version 1.4.1
Server reports RandR version 1.4
xrandr --listactivemonitors
我的安装似乎不受支持。
更新 2 - 重新安装 OS,完全擦除分区:
今天当我决定只采取核选项时,事情迅速升级。幸运的是,磁盘上没有我需要的任何东西,因为我刚刚克隆了我的存储库并且没有进行任何值得提交的更改。
在开放和专有 tary 驱动程序之间交换一天并修改我的 xorg.conf 之后,我最终对磁盘进行了核对并安装了 16.04 LTS。我从 ubuntu 存储库安装了 SDL2 运行时,并从 SDL 网站上的 tar 文件安装了 SDL2 开发源。 运行 我的程序又按预期运行了。
我不想称它为 "solved",因为我最终用核弹 OS,但我想我的问题已经解决了。我只是希望我能弄清楚有关 SDL 如何了解有多少显示器的信息链。
checking for X11/extensions/Xinerama.h... no
这可能就是鱼雷击中你的原因。 Xinerama is used to query the output count/positions/topology:
The X server's client/server architecture allows the server to expose Xinerama information to the client regardless of whether the Xinerama infrastructure is active. RandR and NVidia's twinview utilize this feature to provide window managers and clients with information about the output layout relative to the framebuffer.
安装 libxinerama-dev
并重新configure
ing 可能会解决这个问题。
晚上好。
我正在远程计算机上设置游戏项目,运行遇到 SDL 问题。我正在使用 SDL 2.0,我想弄清楚为什么 SDL_GetNumVideoDisplays() returns 1 当我有 2 个显示器连接到我的 PC 时。我是 运行 Ubuntu 14.04 LTS,两台显示器似乎都配置正确,只是正常使用桌面。
希望获得有关在何处查找以解决此问题的提示。谢谢。
更新 1 - ./configure
用于 SDL2-2.0.4 源代码:
正在寻找配置脚本中对 X11 的一些提及并看到以下内容:
checking for X11/extensions/Xext.h... yes
-- dynamic libX11 -> libX11.so.6
-- dynamic libX11ext -> libXext.so.6
checking for const parameter to XextAddDisplay... yes
checking for XGenericEvent... yes
checking for XkbKeycodeToKeysym in -lX11... yes
checking for X11/Xcursor/Xcursor.h... no
checking for X11/extensions/Xdbe.h... yes
checking for X11/extensions/Xinerama.h... no
checking for X11/extensions/XInput2.h... no
checking for X11/extensions/scrnsaver.h... no
checking for X11/extensions/shape.h... yes
checking for X11/extensions/xf86vmode.h... yes
和
X11 libraries : xdbe xshape xvidmode
我的xrandr --version
是:
xrandr program version 1.4.1
Server reports RandR version 1.4
xrandr --listactivemonitors
我的安装似乎不受支持。
更新 2 - 重新安装 OS,完全擦除分区:
今天当我决定只采取核选项时,事情迅速升级。幸运的是,磁盘上没有我需要的任何东西,因为我刚刚克隆了我的存储库并且没有进行任何值得提交的更改。
在开放和专有 tary 驱动程序之间交换一天并修改我的 xorg.conf 之后,我最终对磁盘进行了核对并安装了 16.04 LTS。我从 ubuntu 存储库安装了 SDL2 运行时,并从 SDL 网站上的 tar 文件安装了 SDL2 开发源。 运行 我的程序又按预期运行了。
我不想称它为 "solved",因为我最终用核弹 OS,但我想我的问题已经解决了。我只是希望我能弄清楚有关 SDL 如何了解有多少显示器的信息链。
checking for X11/extensions/Xinerama.h... no
这可能就是鱼雷击中你的原因。 Xinerama is used to query the output count/positions/topology:
The X server's client/server architecture allows the server to expose Xinerama information to the client regardless of whether the Xinerama infrastructure is active. RandR and NVidia's twinview utilize this feature to provide window managers and clients with information about the output layout relative to the framebuffer.
安装 libxinerama-dev
并重新configure
ing 可能会解决这个问题。