如何使用Android ndk在GLSurface视图上显示多张图片
我能够在 android ndk 中使用 OpenGL ES 显示图像。现在我想通过android ndk在OPENGL ES中使用多线程显示2个或4个图像。 我对此进行了大量搜索,并了解到 Surfaceview 只能有一张图片。那么在 GLSurface 视图上显示多张图片的方法是什么。
任何人都可以告诉我如何做到这一点。
提前致谢
I am able to display an image using OpenGL ES in android ndk. now I want to display 2 or four images using multithreading in OPENGL ES through android ndk.
I have done huge search for this and came to know a Surfaceview can only have one picture. Then what is the way to display multiple pictures on GLSurface view..
Can anybody please tell me how it can be done..
Thanks in Advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看来这里有几个问题。
首先,如果您尝试通过 OpenGL(ES) 显示“图片”,您的意思是纹理(“图片”或“图像”的 OpenGL 可读格式),对吗?如果您不确定我在说什么,请查找一些有关使用 OpenGLES 显示图像的教程。了解如何仅显示 1,您就能够显示 4。
你可能误解了一些东西。 GLSurfaceView 可以绘制视频内存可以处理的尽可能多的纹理。
基本上,要显示纹理,您将绘制 2 或 4 个四边形并将适当的纹理绑定到它们。
关于多线程,我猜你是异步收集图片的。只需等待完整的图片,然后在 OpenGL 线程中创建纹理并将其绑定到四边形。
It seems there are several issues here.
First of all, if you are trying to display "pictures" through OpenGL(ES), you mean textures (OpenGL readable format for "pictures" or "image"), right ? If you are not sure of what I am talking about, find some tutorial about displaying images using OpenGLES. Learn how to display juste 1 and you will be able to display 4.
You may have misunderstand something. A GLSurfaceView can draw as many textures as your video memory can handle.
Basically, to display your textures, you will draw 2 or 4 quads and bind the appropriate textures to them.
About the multithreading, I guess you gather your pictures asynchronously. Just wait for a complete picture, and while in the OpenGL thread, create a texture and bind it to a quad.