android - 我可以在 Android NDK 中使用 glu

标签 android opengl-es android-ndk glu

我似乎无法在我的 Android NDK 项目中包含 glu.h

我正在尝试将现有的 C++ 代码移植到 NDK,它在一些地方使用了 glu(特别是 gluErrorString)。

OpenGLES没有glu吗?

有我可以使用的端口吗?

如果不是,我可能会删除对 gluPerspective 等内容的调用,但是对于 gluErrorString 我该怎么办?

最佳答案

Does OpenGL ES not have glu?

不,它没有。看看这个:Platform OpenGL Includes collection .在Android下只有以下标题:

OpenGL ES 1.1:

#include <GLES/gl.h>
#include <GLES/glext.h>

OpenGL ES 2.0:

#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>

Is there a port I can use?

是的,有部分 GLU 移植到 Android - GLU ES (它支持gluErrorStringgluPerspective 和许多其他功能):

GLU 1.3 partitial port (libutil and libtess components only) for OpenGL ES 1.x (CM - Common profile) and above.

This port supports:

  • Quadrics: gluNewQuadric(), gluDeleteQuadric(), gluQuadricCallback(), gluQuadricNormals(), gluQuadricTexture(), gluQuadricOrientation(), gluQuadricDrawStyle(), gluCylinder(), gluDisk(), gluPartialDisk(), gluSphere().
  • Registry: gluGetString(), gluCheckExtension(), gluErrorString().
  • Projection matrix manipulation: gluOrtho2D(), gluPerspective(), gluLookAt(), gluProject(), gluUnProject(), gluUnProject4(), gluPickMatrix(). 2D Mipmaps: gluScaleImage(), gluBuild2DMipmapLevels(), gluBuild2DMipmaps().
  • Tesselation: gluBeginPolygon(), gluDeleteTess(), gluEndPolygon(), gluGetTessProperty(), gluNewTess(), gluNextContour(), gluTessBeginContour(), gluTessBeginPolygon(), gluTessCallback(), gluTessEndContour(), gluTessEndPolygon(), gluTessNormal(), gluTessProperty(), gluTessVertex().

关于android - 我可以在 Android NDK 中使用 glu,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7589563/

相关文章:

android - 在 sdk 23 或 22 上,标题根本不会出现在 PagerTitleStrip 中

android - Google Play,IntelliJ 中的 Drive API 示例代码

android - OpenGL-ES:如何在触摸坐标处设置对象?

java - 为什么我的 OpenGL 坐标系轴不是 [-1; 1]?

android - OpenGL ES 纹理问题,4 个重复的列和水平线(Android)

java - 为什么我设置 this.getReadableDatabase() 后需要关闭数据库?

javascript - 如何使用 Cordova 获取设备的铃声状态/静音状态?

java - 各种Android OpenGL相关类之间的关系是什么?

Android Studio 编译原生代码显示 "fcntl(): Bad file descriptor"

java - 在 Java 和 C 之间发送 int[]s