By coolhawk
on Wed, 06/20/2012 - 17:11
Hi,i want to uss the thread to change the texture dynamically,but there is something wrong in my code, when i debug the example imagetarget, it didn't work, how should i modify my code?
[CODE]
/** Called when the activity first starts or the user navigates back
* to an activity. */
protected void onCreate(Bundle savedInstanceState)
{
DebugLog.LOGD("ImageTargets::onCreate");
super.onCreate(savedInstanceState);
// Set the splash screen image to display during initialization:
mSplashScreenImageResource = R.drawable.splash_screen_image_targets;
// Load any sample specific textures:
mTextures = new Vector();
loadTextures();
// Query the QCAR initialization flags:
mQCARFlags = getInitializationFlags();
// Update the application status to start initializing application
updateApplicationStatus(APPSTATUS_INIT_APP);
[COLOR=DarkRed]Here is my code:[/COLOR]
new Thread(){
public void run(){
while(true){
Texture temp = mTextures.elementAt(0);
mTextures.set(0, mTextures.elementAt(1));
mTextures.set(1, temp);
deinitApplicationNative();
initApplicationNative(mScreenWidth, mScreenHeight);
mRenderer.initRendering();
try{
Thread.sleep(3000);
}
catch(InterruptedException e){
e.printStackTrace();
}
}
}
}.start();
}
[/CODE]
Re: how can i change the texture dynamically using thread
Re: how can i change the texture dynamically using thread
Re: how can i change the texture dynamically using thread
Re: how can i change the texture dynamically using thread