如何使用Android ndk在GLSurface视图上显示多张图片

发布于 2025-01-03 09:24:47 字数 192 浏览 3 评论 0原文

我能够在 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 技术交流群。

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

发布评论

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

评论(1

鲸落 2025-01-10 09:24:47

看来这里有几个问题。

首先,如果您尝试通过 OpenGL(ES) 显示“图片”,您的意思是纹理(“图片”或“图像”的 OpenGL 可读格式),对吗?如果您不确定我在说什么,请查找一些有关使用 OpenGLES 显示图像的教程。了解如何仅显示 1,您就能够显示 4。

一个Surfaceview只能有一张图片

你可能误解了一些东西。 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.

a Surfaceview can only have one picture

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.

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