Vertex Array Objects for Android?

I am writing Android code to prepare a graphical application that I plan to develop. I have not done OpenGL since 2004. I came across http://www.opengl.org/wiki/Vertex_Array_Object and several sources for the PC platform claim that using vertex array objects is the best way to render.

My target platform is a Motorola Atrix 2 smartphone with Android 2.3.

I can't seem to find an include for a function matching GL_OES_vertex_array_object. I want to call functions like glGenVertexArraysOES.

How to use VAO in Android?

My current events include

import java.nio.Buffer; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.CharBuffer; import java.nio.FloatBuffer; import java.nio.IntBuffer; import javax.microedition.khronos.opengles.GL10; import javax.microedition.khronos.opengles.GL11; 
+4
source share
2 answers

VAOs are fairly new and not included in OpenGL | ES 1.0 or 1.1 (not to be confused with Buffer Objects , or as they are sometimes called VBOs ). You will have to import and use OpenGL | ES 2.0, and at the same time you will have to make some changes to the graphic code for drawing through shaders instead of glVertexPointer and similar methods. In appearance, there is no GL20Ext class or similar built-in in Android, I would look around the network for binding or write them myself using the NDK.

+4
source

On some devices, the VAO extension is not performed. First check the version of OpenGl ES with

 gl.glGetString(GL10.GL_VERSION); 

Then check if the extension is available with

 gl.glGetString(GL10.GL_EXTENSIONS); 

it should contain: GL_OES_vertex_array_object

More about extensions: OpenGL extensions available across Android devices

For more information about VAO on Android validation: OES_vertex_array_object and client status

Edit: Change the answer to answer the question correctly. thanks for the comment.

+1
source

Source: https://habr.com/ru/post/1403410/


All Articles