将普通View转换为GLSurfaceView的教程
我有 opengl 编程和使用 android sdk 的经验,但我从未在 android 中使用过 opengl,并且我有一个项目仅使用常规视图和画布来完成所有绘图。这一切都很好,直到我们开始将应用程序投入实际使用,屏幕上可能同时浮动 40 个或更多位图,然后即使在较新的测试硬件上,应用程序也会显着减慢速度。
我知道我可以使用 opengl es、ndk 或 GLSurfaceView
,但我想从社区了解:
是否有任何教程或材料旨在将现有视图转换为GLSurfaceView
?
我在想,如果我在GLSurfaceView
中使用opengl,我会得到很好的性能提升。我想要重写的自定义视图非常简单,但我在扩展 GLSurfaceView 并为其正确创建渲染器时遇到了一些麻烦。一切都显示为黑色,除非我将其全部透明,无论哪种方式,你都看不到任何东西。
因此,如果有人能给我省去“阅读文档”的答案,并为我指出一个可以节省我三天阅读时间的教程,我将非常感激:)
I have experience in programming both opengl and using the android sdk but I've never used opengl in android and I have a project that is using just regular views and canvases to do all the drawing. That was fine until we started putting the app into real world use where there was possibly 40 or more bitmaps floating around on the screen at once and then the app SLOWS DOWN considerably even on newer test hardware.
I know that I can use opengl es, the ndk, or an GLSurfaceView
but I would like to know from the community:
Are there are any tutorials or materials geared towards converting an existing view to a GLSurfaceView
?
I'm thinking if I use opengl in a GLSurfaceView
I'll get a nice performance boost. The custom view that I want to rewrite is pretty straight forward but I had some trouble getting it to extend GLSurfaceView
and properly creating the Renderer for it. Everything came out black except when I made it all transparent and either way it you couldn't see anything.
So if some one can spare me the "Read the Documentation" answer and point me to a tutorial that would save me three days reading time I would gladly appreciate it :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该尝试本教程:Android 第一课:入门
You should try this tutorial: Android Lesson One: Getting Started