11

Just couldn't find anything regarding the purpose of android.opengl classes anywhere on the web: they seem to be copies of javax.microedition.khronos.opengles - just with static vs member methods.

So is there any special meaning in using them instead of J2ME classes: are they supposed to be faster, have additional functionality, simpler to work with?

I think of using them instead of passing that GL reference all the time.

myself
  • 482
  • 3
  • 21
  • I know it may create problems when porting but that does not seem to be a big issue for me. – myself Nov 07 '10 at 13:21

3 Answers3

3

Ok, just in case someone is really interested in the difference between android.opengl and OpenGL ES standard javax.microedition.khronos.opengles packages, the following can be found in Android's classic ApiDemos project: javadoc for com.example.android.apis.graphics.StaticTriangleRenderer class tells that android.opengl package simply provides a bit more functionality then standard khronos package, and, quite handy, it's easier for C developers who can simply write glBindBuffer(...) instead of ((GL20) gl).glBindBuffer(...).

myself
  • 482
  • 3
  • 21
0

Best bet is that the Android ones are optimized and adapted for Android. It's the same with the SAX parser there is the org.xml.sax package and the android.sax package but I think both versions of the parser are optimized for Android.

Octavian Helm
  • 39,405
  • 19
  • 98
  • 102
  • The thing is traceview tool in SDK shows static call "GLES10.glClear" to be much slower than virtual "gl.glClear". In other words, Android-specific classes appear to be slower than j2me generic ones. – myself Nov 07 '10 at 20:04
0

Android includes support for high performance 3D graphics via the OpenGL API — specifically, the OpenGL ES API.

OpenGL ES is a flavor of the OpenGL specification intended for embedded devices. Versions of OpenGL ES are loosely peered to versions of the primary OpenGL standard. Android currently supports OpenGL ES 1.0, which corresponds to OpenGL 1.3. So, if the application you have in mind is possible with OpenGL 1.3 on a desktop system, it should be possible on Android.

Tushar Gupta
  • 1,410
  • 13
  • 22