How do a use GLUt in native code on android?
I am currently playing around on the NDK for android, trying out the OpenGL ES 2.0 capabilities. But i don't know how to load an image into an OpenGL texture. My plan is to send a bitmap with t开发者_Python百科he native function call and then use GLUt to make a texture out of it. So, how do i use GLUt in native code on the android platorm?
Or is this he wrong take on the problem?
(sorry for bad english).
Thanx in advance!
These depends on what is your app doing, if you are developing a game, the best way is to read the images from the sdcard or send the file descriptor from an asset in the apk, and use stdio and libpng or a similar lib (depending on your images format), decode the image in native code and bind the texture there.
In the other hand if your images are being generated on the fly (eg: from the Camera), the best way is to pass it to the native code with java.nio.ByteBuffer or similar.
精彩评论