简体   繁体   中英

Android: How to Debug an OpenGL-ES app

My question seems really silly. But I really headache with this question. For example you use canvas to draw something on Screen (example: line, square) You just take one line of code. So, when debug, when you go through that line, and bad result ( nothing happened, not draw what you want,...) You totally know that something wrong with that line or parameter of its method.

But when I come to OpenGL, just a triangle (with color texture,...), you must use "many line of code" : create byteBuffer , convert to floatBuffer , enable some state that you will use... And when debug, something wrong, I cannot know why (It can be wrong parameter, or I missing something,...). Debugger just help me view flow-of-code and see how it work.

I need some advice of people here to overcome this. Please help me.

thanks :)

实际上,有一个称为Tracer for OpenGL ES的Eclipse工具

The first thing I would do is look at Logcat output. Look for errors coming from your app.

To see Logcat output in Eclipse, find the DDMS view.

Otherwise, you can go to: Window > Show View > Other Then expand Android and then select Logcat

Other than LogCat and tracing, there really isn't much more you can do other than trying to understand the fine grain details of what each line of the code does. Your question is quite open-ended, do you have a specific example of a problem that you ran into? Anyhow, I found this site as a good learning resource when I first started learning about OpenGL ES.

However, for game development,I tend to lean towards using open source frameworks that wraps around OpenGL ES like libgdx or AndEngine (for games).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM