views:

138

answers:

2

Hi all,

I have a byte array of RGB values, just like the contents(without header) of a *.bmp file. What I want to do is, draw the corresponding bitmap on Android, using OpenGL.

It seems that OpenGL ES doesn't have a single API that will do, it true?

If true, how can I do this?

PS: Actually, I can draw it in JAVA code, but it's too slow and costs too much CPU time. So I want to try drawing it with OpenGL. Is there any other advises? Or maybe OpenGL can't be the right answer?

Thank you all!

A: 

That's a very general question, you can find lots of Android OpenGL ES code samples on the internet.

A good start however would be the Google IO talks on writing real time games for Android:

http://code.google.com/events/io/2009/sessions/WritingRealTimeGamesAndroid.html

http://www.androidphonethemes.com/google-io-2010-writing-real-time-games-for-android-redux

See page 23 to 25 of the first presentation I just linked for a comparison of the existing different Canvas and OpenGL ES drawing methods in Android.

Julio Gorgé
+2  A: 

bmp is a really bad format to start off with, you should use png files. They are smaller and offer the same quality. They're also easy to work with using openGL.

You can easily do it in Android. You'll want to look into texture loading. Here's a link: http://qdevarena.blogspot.com/2009/02/how-to-load-texture-in-android-opengl.html

Miguel Morales