Android:如何调试 OpenGL-ES 应用程序

发布于 2025-01-07 08:46:59 字数 392 浏览 4 评论 0原文

我的问题看起来真的很愚蠢。但这个问题我真的很头疼。例如,您使用 canvas 在屏幕上绘制某些内容(例如:直线、正方形),您只需一行代码。因此,在调试时,当您浏览该行并得到不好的结果(什么也没发生,没有绘制您想要的内容,...)您完全知道该行或其方法的参数有问题。

但是当我来到OpenGL时,只是一个三角形(带有颜色纹理,...),你必须使用“多行代码”:创建byteBuffer,转换为floatBuffer ,启用您将使用的某些状态...并且在调试时,出现问题,我不知道为什么(可能是错误的参数,或者我丢失了某些东西,...)。调试器只是帮助我查看代码流并了解它是如何工作的。

我需要这里人们的一些建议来克服这个问题。请帮我。

谢谢 :)

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 :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

风尘浪孓 2025-01-14 08:46:59

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

Actually, there is an Eclipse tool called Tracer for OpenGL ES

一抹微笑 2025-01-14 08:46:59

我要做的第一件事是查看 Logcat 输出。查找来自您的应用程序的错误。

要在 Eclipse 中查看 Logcat 输出,请找到 DDMS 视图。

否则,您可以访问:
窗口>显示视图>其他
然后展开Android,然后选择Logcat

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

苯莒 2025-01-14 08:46:59

除了 LogCat 和跟踪之外,除了尝试了解每行代码的作用的细粒度细节之外,您实际上无能为力。你的问题很开放,你有遇到过的问题的具体例子吗?无论如何,当我第一次使用时,我发现这个网站是一个很好的学习资源开始学习OpenGL ES。

然而,对于游戏开发,我倾向于使用围绕 OpenGL ES 的开源框架,如 libgdx 或 AndEngine(用于游戏)。

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).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文