Search This Blog

Tuesday 17 July 2012

Basics of OpenGL in Android


Basics about OpenGL ES for Android


OpenGL is an open graphics library to create the high performance 2D and 3D applications.The OpenGL ES is a specification for the embedded devices. The devices comes with GPU (graphics processing unit) accelerate the OpenGL functions and draw the high quality graphics on the screen.


There is lot of stuff on OpenGL which is not useful to start quickly with OpenGL ES on Android. This post is giving a quick start-up for developers to easily understand the basic about the OpenGL ES concepts around the Android application development.


OpenGL is a cross platform library and supports on multiple platforms.


Android support the OpenGL interface programming using the application development in java as well as the native (NDK) support.


The Android SDK has a android.opengl package to create the OpenGL graphics in android applications.


The android.opengl is a static interface and implements the OpenGL ES 1.0/1.1 specifications to create a high performance graphics in 2D and 3D.


The two main classes which need to implement in an OpenGL based application on android platform are as follows.


GLSurfaceView - GLSurfaceView provides a View class to implement with OpenGL 2D and 3D APIs just like the normal SurfaceView in Android. You can extend the GLSurfaceView class to create your own class and use that View to create for your activity.


All the events you want to handle on this view need to implement in the class you extended with GLSurfaceView.


GLSurfaceView.Renderer - This is an interface which provides the class to draw the OpenGL objects in GLSurfaceView. You should implement a separate class for Renderer and use that class to associate with GLSurfaceView instance by using the setRenderer method.


Now you can start trying with OpenGL samples for Android.


See the first sample here


http://creativeandroidapps.blogspot.in/2012/07/sample-code-for-open-gl-in-android.html


If you like this article then please provide your valuable comments.


Thanks
Creative Android Apps







3 comments:

  1. Easily under standable, good.

    ReplyDelete
  2. Very useful information about the OpenGL ES for Android.

    LifeVoxel.AI's Interactive Streaming and AI Platform for imaging using GPU cluster cloud computing have created a revolution. There is no need for expensive hardware costs.

    Interactive Streaming Artificial Intelligence Platform RIS PACS

    ReplyDelete
  3. I would like to thank you for the efforts you have made in writing this article, Its good and Informative.
    android online training hyderabad

    ReplyDelete