By tarun31
on Sat, 10/20/2012 - 14:11
Hey Guys,
Need help on a small thing. What i want to do is that i want to load textures from apk or from sdcard at runtime and be able to use them. I do not want to initialise them at the startup of the app e.g. if a user presses a button these textures should load from the sdcard or apk and be ready for use. Also i have got a basic idea that i can do this using the async task in background but not able to implement it i.e.what function calls to do in order to go complete the total loading process and update mtextures. Could somebody please give me some hints on how to move forward on this?
Thanks in advance,
Tarun
Load textures from apk at runtime
It is certainly possible to load textures at runtime; to do that you will need to pay attention to the following (I’m referring to the ImageTargets sample to have a common point of
Load textures from apk at runtime
Thanks a lot for the detailed reply!! Will try out what you have suggested and get back!
Load textures from apk at runtime
Yes, let me know how it goes, and if I can help more.
Load textures from apk at runtime
Hey,
Tried everything as you said and the textures are being loaded into the system. But when it comes to render the textures it turns out black(the image is 256*256). Not getting what the problem is? Any help or pointers please?
Thanks
Load textures from apk at runtime
Hi, can you paste here the relevant code snippets where you do:
1- create your textures in OpenGL (code with glGenTextures(...) and surrounding code)
2- bind your texture to render them (code with glBindTexture() and its surrounding code)
?
Hi. i have the same
Hi.
i have the same problem, trying to load textures at run time does not work for me,
i found a work-around for the time beeing: i followed everything allesandroB suggested , as well as calling
Hi ozieg, if I understand
Hi ozieg,
if I understand correctly, you call glTexImage at every rendering frame, are you?
Note that this should not be necessary, i.e. you should call glTexImage only if you detect that a new image has been loaded and a new texture must be created;
Hi AllessandroB. thanks for
Hi AllessandroB.
thanks for your fast replay, i now managed to solve the issue and load textures at run-time
thanks alot
ozi
Glad to hear it. You're
Glad to hear it. You're welcome.
Hi! I just solved this
Hi! I just solved this problem and I'd like to share my methods with you. The key problem is not about the texture size( it doesn't need to be size of power of 2).