Can I use glu with Android NDK

久未见 提交于 2019-11-30 01:20:42

问题


I can't seem to include glu.h in my Android NDK project.

I'm trying to port existing C++ code to NDK, and it uses glu in a few places (notably gluErrorString).

Does OpenGLES not have glu?

Is there a port I can use?

If not I can probably remove the calls to things like gluPerspective and so on, but what do I do about gluErrorString?


回答1:


Does OpenGL ES not have glu?

No, it doesn't. Look at this: Platform OpenGL Includes collection. Under Android there are only the following headers:

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?

Yes, there is a partial port of GLU for Android - GLU ES (it supports gluErrorString, gluPerspective and numerous other functions):

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().


来源:https://stackoverflow.com/questions/7589563/can-i-use-glu-with-android-ndk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!