加载纹理到一个线程块mainUI在android系统 [英] load textures into a thread blocks the mainUI in android
问题描述
我尝试加载位图,并将其显示到纹理(openglES2.0)。
我做一个运行线程,一旦加载发送到纹理的位图。
甚至我线程可运行,主UI线程图片的加载过程中冻结一段时间。
我真的不明白这一点,是pretty失去了它...任何线索?
I try to load bitmaps and display them into textures (openglES2.0). I make a runnable thread, and once loaded the bitmap are sent to textures. Even my thread is runnable, the main UI Thread freezes for a while during the loading of pictures. I really don't understand this and am pretty lost about it… any clues ?
推荐答案
听起来你打电话myThread.run()而不是myThread.start()
Sounds like you're calling myThread.run() instead of myThread.start()
run()的执行调用线程,但启动()使一个新的线程,然后那里面运行的电话。
run() executes in the calling thread, but start() makes a new thread and then calls run inside of that.
如果这不是这种情况,我真的不能帮你没有你的相关code。
If that's not the case, I can't really help you without your relevant code.
这篇关于加载纹理到一个线程块mainUI在android系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!