public class AcObject {
/** Our texture pointer */
private int[] textures = new int[3];
// objects properties
private String name = "";
private String data = "";
private String texture = "none";
See the
private String texture = "none";this is important.
Later, when I load textures in the same class I use this:
public void loadGLTexture(GL10 gl, Context context) {
if (this.texture.equals("none")) {
Log.i("AcLoader", ">>>> NO TEXTURE TO LOAD");
return;
} else
Log.i("AcLoader", ">>>> LOADING TEX: " + this.texture);
The Log.i call just outputs to the debug log for android, so I can see what my code's doing
this part:
if (this.texture.equals("none")) {
works perfectly! I can tell by viewing the output log, and all the AcObjects that don't have textures report "NO TEXTURE TO LOAD"
However...
When I attempt to Draw, I use the following code:
public void draw(GL10 gl, int filter) {
// Bind the texture according to the set texture filter
if(!this.texture.equals("none"))
gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[filter]);
The condition:
if(!this.texture.equals("none"))
Always evaluates false and the ! flips it to true. Note that, from the time the texture is attempted to load, the model is already done loading, and nothing would / should modify the this.texture at all.
Further, if I print the this.texture to the log, it prints "none"
so I KNOW that this.texture DOES equal "none" because I print it to the log... yet this always evaluates as !(false)
Whats going on? Tearing my hair out...
-Greg
Edit: hit post by mistake, sorry
This post has been edited by geem42: 28 November 2010 - 10:03 PM

New Topic/Question
Reply



MultiQuote










|