TextureManager.loadTexture usage doesn't match the HelloStates tutorial

In HelloStates the following code doesn't work - I guess because I'm on version 0.10 of jme. 



    TextureManager.loadTexture(monkeyLoc, Texture.MM_LINEAR, Texture.FM_LINEAR, true);



The problem seems to be that this loadTexture method now expects an additional parameter (float anisoLevel) which is not supplied.  I've tried playing around but can't get it to work currently.


OK - was actually another problem.  Giving a value for the new variable of 1 seems to work fine, though could do with some info on what it is as the API is patchy.



:slight_smile:

Hit a problem with the next one, but found the solution in another thread - posting here in case anyone sees this first.



The tutorials in the WIKI can be out of date.  The source code downloaded includes the up to date tutorial code so use it from there.


USE THIS

Convert url to image







URL monkeyLoc;

monkeyLoc=HelloStates.class.getClassLoader().getResource("jmetest/data/images/Monkey.tga");

java.awt.Image image = java.awt.Toolkit.getDefaultToolkit().getDefaultToolkit().createImage(monkeyLoc);

// Get a TextureState

TextureState ts=display.getRenderer().createTextureState();

// Use the TextureManager to load a texture



Texture t =  TextureManager.loadTexture(image, Texture.MM_LINEAR, Texture.FM_LINEAR,true);