如何在Ubuntu上获取OpenGL man手册,例如“man glRotate”?

14

在 MacOSX 上,输入 "man glRotate" 可以打开 glRotate 的 manpage。

在 Ubuntu 上,需要安装 manpages-dev 和 manpages-posix-dev,但即使这样输入 "man glRotate" 也无法打开 glRotate 的 manpage(尽管我可以构建和编译 gl 应用程序)。

我错过了什么?我该如何设置才能实现这一点?


1
希望手册能在下一个Ubuntu版本中发布:https://bugs.launchpad.net/ubuntu/+source/mesa/+bug/32042请阅读评论以找到手动安装的方法。 - sisis
"man glRotate" 对我来说完全正常!...我是在输入到谷歌搜索栏里,这会改变什么吗?" - codewarrior
2个回答

7
sudo apt-get install opengl-4-man-doc opencl-1.2-man-doc

该文档包含许多手册页,例如:

man glDrawArrays

但是它没有包含man glRotate。我认为这是因为已弃用的即时API未被包括在内。

apt-file search glRotate显示了一些结果,但它们似乎不是“官方”的。

在Ubuntu 16.04上测试过。


也找不到gluOrtho2D - user8874182
@helal 可能是因为它不是OpenGL API的一部分,而是GLU库的一部分。不幸的是,它似乎没有与freeglut-dev捆绑在一起,而freeglut是主要的Linux实现。如果您找到包含它的软件包,请告诉我。 - Ciro Santilli OurBigBook.com
我邀请你。https://stackoverflow.com/questions/48771076/how-to-make-a-3d-window-for-drawing-3d-points-in-c-using-opengl-functions - user8874182
@helal 建议:在提问时,说明您运行代码时发生了什么,并说明您希望发生什么。我建议您使用以下任一教程:https://github.com/JoeyDeVries/LearnOpenGL 或 https://github.com/opengl-tutorials/ogl - Ciro Santilli OurBigBook.com
GLX怎么样?也有相应的软件包吗? - szx

3
将Khronos的OpenGL-Refpages repository与Arch的opengl-man-pages中的PKGBUILD脚本结合起来。
# $Id$
# Maintainer: AndyRTR <andyrtr@archlinux.org>

pkgname=opengl-man-pages
pkgver=20170404
_commit=03552a8094ae3017e0b8b2ad44c602f81c03e848
pkgrel=1
pkgdesc="OpenGL Man Pages"
arch=('any')
url="https://github.com/KhronosGroup/OpenGL-Refpages"
license=('custom')
# OpenGL 4.x (current) API and GLSL pages - libxslt' 'docbook-xsl'
# OpenGL 3.x and older 'w3c-mathml2' 'docbook-mathml'
makedepends=('libxslt' 'docbook-xsl' 'w3c-mathml2' 'docbook-mathml' 'git')
source=(${pkgname}::git+https://github.com/KhronosGroup/OpenGL-Refpages#commit=$_commit
        'LICENSE')
sha256sums=('SKIP'
            'a7b2f6669d7ead91dcaf5a03620cdf9d37c54d83fd1899b4ef84683c7e6d4024')
# gl2.1 = OpenGL 2.1 (including fixed functionality)
# es3   = OpenGL ES 3.x (will always be the latest ES, currently 3.2)
# gl4   = OpenGL 4.x (current) API and GLSL pages
_mandirs=(gl4 es3 gl2.1)

pkgver() {
  date +%Y%m%d
}

build() {
  export WD=`pwd`
  xmlcatalog --create --noout \
    --add public "-//W3C//DTD MathML 2.0//EN" "file:///usr/share/xml/w3c/mathml2/mathml2.dtd" \
    --add public "-//W3C//DTD MathML//EN" "file:///usr/share/xml/w3c/mathml2/mathml2.dtd" \
    --add system "http://www.w3.org/TR/MathML2/dtd/mathml2.dtd" "file:///usr/share/xml/w3c/mathml2/mathml2.dtd" \
    mathml2.cat
  export XML_CATALOG_FILES="$WD/mathml2.cat /etc/xml/catalog"

  for manpages in ${_mandirs[@]}; do
    cd "${srcdir}/${pkgname}/${manpages}"
    for file in gl*.xml; do
      xsltproc --noout --nonet /usr/share/xml/docbook/xsl-stylesheets-*/manpages/docbook.xsl ${file}
    done
  done
}

package() {
  install -d "${pkgdir}/usr/share/man/man3"
  for manpages in ${_mandirs[@]}; do
    cd "${srcdir}/${pkgname}/${manpages}"
    install -m644 *.3G "${pkgdir}/usr/share/man/man3/"
  done
  # license
  install -D -m644 "${srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}

我需要在我的Debian Stretch系统上安装额外的软件包来构建文档:

sudo apt-get install xsltproc docbook-xsl docbook-xsl-ns w3-dtd-mathml docbook-mathml

1
请注意,此软件包似乎最后一次更新是在2009年。 - Ruslan
@Ruslan:已更新为使用OpenGL-Refpages存储库。 - genpfault
我尝试下载软件包(Arch软件包页面中的“从镜像下载”链接),但发现其中许多手册页格式不佳。例如,查看man /path/to/glTexStorage2DMultisample.3G.gz。如果你将其与Ciro提供的答案中引用的Ubuntu的opengl-4-man-doc进行比较,你会发现Ubuntu的手册页很好(已检查Trusty的软件包)。不过我不知道Ubuntu是从哪里获取这些手册页的。 - Ruslan

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接