Commits

Anonymous committed 2c70ba8

removed TextureImpl static bindNone().
added Texture non-static unbind().

Comments (0)

Files changed (17)

trunk/Slick/src/org/newdawn/slick/Graphics.java

 		
 		predraw();
 		currentColor.bind();
-		TextureImpl.bindNone();
+//		TextureImpl.bindNone();
 		
 		LSR.start();
 		LSR.vertex(x1, y1);
 	 */
 	public void draw(Shape shape, ShapeFill fill) {
 		predraw();
-		TextureImpl.bindNone();
+//		TextureImpl.bindNone();
 		
 		ShapeRenderer.draw(shape, fill);
 		
 	 */
 	public void fill(Shape shape, ShapeFill fill) {
 		predraw();
-		TextureImpl.bindNone();
+//		TextureImpl.bindNone();
 		
 		ShapeRenderer.fill(shape, fill);
 		
 	 */
 	public void draw(Shape shape) {
 		predraw();
-		TextureImpl.bindNone();
+//		TextureImpl.bindNone();
 		currentColor.bind();
 		
 		ShapeRenderer.draw(shape);
 	 */
 	public void fill(Shape shape) {
 		predraw();
-		TextureImpl.bindNone();
+//		TextureImpl.bindNone();
 		currentColor.bind();
 		
 		ShapeRenderer.fill(shape);
 	 */
 	public void texture(Shape shape, Image image, float scaleX, float scaleY, boolean fit) {
 		predraw();
-		TextureImpl.bindNone();
+//		TextureImpl.bindNone();
 		currentColor.bind();
 		
 		if (fit) {
 	 */
 	public void texture(Shape shape, Image image, float scaleX, float scaleY, ShapeFill fill) {
 		predraw();
-		TextureImpl.bindNone();
+//		TextureImpl.bindNone();
 		currentColor.bind();
 		
 		ShapeRenderer.texture(shape, image, scaleX, scaleY, fill);
 	 */
 	public void fillRect(float x1, float y1, float width, float height) {
 		predraw();
-		TextureImpl.bindNone();
+//		TextureImpl.bindNone();
 		currentColor.bind();
 		
 		GL.glBegin(SGL.GL_QUADS);
 	 */
 	public void drawArc(float x1, float y1, float width, float height, int segments, float start, float end) {
 		predraw();
-		TextureImpl.bindNone();
+//		TextureImpl.bindNone();
 		currentColor.bind();
 		
 		while (end < start) {
 	 */
 	public void fillArc(float x1, float y1, float width, float height, int segments, float start, float end) {
 		predraw();
-		TextureImpl.bindNone();
+//		TextureImpl.bindNone();
 		currentColor.bind();
 		
 		while (end < start) {
 			float green2, float blue2, float alpha2) {
 		predraw();
 		
-		TextureImpl.bindNone();
+//		TextureImpl.bindNone();
 		
 		GL.glBegin(SGL.GL_LINES);
 		
 	public void drawGradientLine(float x1, float y1, Color Color1, float x2, float y2, Color Color2) {
 		predraw();
 		
-		TextureImpl.bindNone();
+//		TextureImpl.bindNone();
 		
 		GL.glBegin(SGL.GL_LINES);
 		

trunk/Slick/src/org/newdawn/slick/Image.java

 	 */
 	Image(ImageBuffer buffer) {
 		this(buffer, FILTER_LINEAR);
-		TextureImpl.bindNone();
+//		TextureImpl.bindNone();
 	}
 
 	/**
 	 */
 	Image(ImageBuffer buffer, int filter) {
 		this((ImageData) buffer, filter);
-		TextureImpl.bindNone();
+//		TextureImpl.bindNone();
 	}
 
 	/**
 		}
 	}
 
+	/** unbinds the texture */
+	public void unbind() {
+		texture.unbind();
+	}
+	
 	/**
 	 * Bind to the texture of this image
 	 */
 	 */
 	public void drawEmbedded(float x,float y,float width,float height) {
 		init();
-
+		float texTop = flipped ? textureOffsetY : textureOffsetY + textureHeight;
+		float texBot = flipped ? textureOffsetY + textureHeight : textureOffsetY;
 		if (corners == null) {
 			// texture top left
-			GL.glTexCoord2f(textureOffsetX, textureOffsetY + textureHeight);
+			GL.glTexCoord2f(textureOffsetX, texTop);
 			GL.glVertex3f(x, y, 0);
 			// bottom left
-			GL.glTexCoord2f(textureOffsetX, textureOffsetY);
+			GL.glTexCoord2f(textureOffsetX, texBot);
 			GL.glVertex3f(x, y + height, 0);
 			// bottom right
-			GL.glTexCoord2f(textureOffsetX + textureWidth, textureOffsetY);
+			GL.glTexCoord2f(textureOffsetX + textureWidth, texBot);
 			GL.glVertex3f(x + width, y + height, 0);
 			// top right
-			GL.glTexCoord2f(textureOffsetX + textureWidth, textureOffsetY + textureHeight);
+			GL.glTexCoord2f(textureOffsetX + textureWidth, texTop);
 			GL.glVertex3f(x + width, y, 0);
 		} else {
 			corners[TOP_LEFT].bind();
-			GL.glTexCoord2f(textureOffsetX, textureOffsetY);
+			GL.glTexCoord2f(textureOffsetX, texTop);
 			GL.glVertex3f(x, y, 0);
 			corners[BOTTOM_LEFT].bind();
-			GL.glTexCoord2f(textureOffsetX, textureOffsetY + textureHeight);
+			GL.glTexCoord2f(textureOffsetX, texBot);
 			GL.glVertex3f(x, y + height, 0);
 			corners[BOTTOM_RIGHT].bind();
-			GL.glTexCoord2f(textureOffsetX + textureWidth, textureOffsetY
-					+ textureHeight);
+			GL.glTexCoord2f(textureOffsetX + textureWidth, texBot + textureHeight);
 			GL.glVertex3f(x + width, y + height, 0);
 			corners[TOP_RIGHT].bind();
-			GL.glTexCoord2f(textureOffsetX + textureWidth, textureOffsetY);
+			GL.glTexCoord2f(textureOffsetX + textureWidth, texTop);
 			GL.glVertex3f(x + width, y, 0);
 		}
 	}
 		} 
 
 		texture.bind(); 
-
+GL.glPushMatrix();
 		GL.glTranslatef(x, y, 0);
 		if (angle != 0) {
 			GL.glTranslatef(centerX, centerY, 0.0f); 
 		GL.glVertex3f(0, 0, 0);
 		GL.glTexCoord2f(textureOffsetX, textureOffsetY + textureHeight);
 		GL.glVertex3f(hshear, height, 0);
-		GL.glTexCoord2f(textureOffsetX + textureWidth, textureOffsetY
-				+ textureHeight);
+		GL.glTexCoord2f(textureOffsetX + textureWidth, textureOffsetY + textureHeight);
 		GL.glVertex3f(width + hshear, height + vshear, 0);
 		GL.glTexCoord2f(textureOffsetX + textureWidth, textureOffsetY);
 		GL.glVertex3f(width, vshear, 0);
 		GL.glEnd(); 
 
-		if (angle != 0) {
-			GL.glTranslatef(centerX, centerY, 0.0f); 
-			GL.glRotatef(-angle, 0.0f, 0.0f, 1.0f); 
-			GL.glTranslatef(-centerX, -centerY, 0.0f); 
-		}
-		GL.glTranslatef(-x, -y, 0);
+//		if (angle != 0) {
+//			GL.glTranslatef(centerX, centerY, 0.0f); 
+//			GL.glRotatef(-angle, 0.0f, 0.0f, 1.0f); 
+//			GL.glTranslatef(-centerX, -centerY, 0.0f); 
+//		}
+//		GL.glTranslatef(-x, -y, 0);
+GL.glPopMatrix();		
+		texture.unbind();
 	} 
 
 	/**
 		float centerY = this.centerY * (height / (float)getHeight());
 
 		texture.bind();
-
+GL.glPushMatrix();
 		GL.glTranslatef(x, y, 0);
 		if (angle != 0) {
 			GL.glTranslatef(centerX, centerY, 0.0f); 
 		drawEmbedded(0,0,width,height); 
 		GL.glEnd(); 
 
-		if (angle != 0) {
+/*		if (angle != 0) {
 			GL.glTranslatef(centerX, centerY, 0.0f); 
 			GL.glRotatef(-angle, 0.0f, 0.0f, 1.0f); 
 			GL.glTranslatef(-centerX, -centerY, 0.0f); 
 		}
-		GL.glTranslatef(-x, -y, 0);
+		GL.glTranslatef(-x, -y, 0);*/
+GL.glPopMatrix();
+//		TextureImpl.bindNone();
+        texture.unbind();
 	} 
 
 	/**
 		}
 
 		GL.glTexEnvi(SGL.GL_TEXTURE_ENV, SGL.GL_TEXTURE_ENV_MODE, SGL.GL_MODULATE);
-
+GL.glPushMatrix();
 		GL.glTranslatef(x, y, 0);
 		if (angle != 0) {
 			GL.glTranslatef(centerX, centerY, 0.0f); 
 		drawEmbedded(0,0,width,height);
 		GL.glEnd();
 
-		if (angle != 0) {
-			GL.glTranslatef(centerX, centerY, 0.0f); 
-			GL.glRotatef(-angle, 0.0f, 0.0f, 1.0f); 
-			GL.glTranslatef(-centerX, -centerY, 0.0f); 
-		}
-		GL.glTranslatef(-x, -y, 0);
-
+//		if (angle != 0) {
+//			GL.glTranslatef(centerX, centerY, 0.0f); 
+//			GL.glRotatef(-angle, 0.0f, 0.0f, 1.0f); 
+//			GL.glTranslatef(-centerX, -centerY, 0.0f); 
+//		}
+//		GL.glTranslatef(-x, -y, 0);
+GL.glPopMatrix();
 		if (GL.canSecondaryColor()) {
 			GL.glDisable(SGL.GL_COLOR_SUM_EXT);
 		}
+		
+		texture.unbind();
 	}
 
 	/**
 
 		float centerX = this.centerX * ((x2-x) / (float)getWidth());
 		float centerY = this.centerY * ((y2-y) / (float)getHeight());
-
+GL.glPushMatrix();
 		GL.glTranslatef(x, y, 0);
 		if (angle != 0) {
 			GL.glTranslatef(centerX, centerY, 0.0f); 
 		drawEmbedded(0,0,x2-x,y2-y,srcx,srcy,srcx2,srcy2);
 		GL.glEnd(); 
 
-		if (angle != 0) {
-			GL.glTranslatef(centerX, centerY, 0.0f); 
-			GL.glRotatef(-angle, 0.0f, 0.0f, 1.0f); 
-			GL.glTranslatef(-centerX, -centerY, 0.0f); 
-		}
-		GL.glTranslatef(-x, -y, 0);
-
+//		if (angle != 0) {
+//			GL.glTranslatef(centerX, centerY, 0.0f); 
+//			GL.glRotatef(-angle, 0.0f, 0.0f, 1.0f); 
+//			GL.glTranslatef(-centerX, -centerY, 0.0f); 
+//		}
+//		GL.glTranslatef(-x, -y, 0);
+GL.glPopMatrix();
+		texture.unbind();
 		//		GL.glBegin(SGL.GL_QUADS);
 		//		drawEmbedded(x,y,x2,y2,srcx,srcy,srcx2,srcy2);
 		//		GL.glEnd();
 	public void drawWarped(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4) {
 		Color.white.bind();
 		texture.bind();
-
+GL.glPushMatrix();
 		GL.glTranslatef(x1, y1, 0);
 		if (angle != 0) {
 			GL.glTranslatef(centerX, centerY, 0.0f);
 		GL.glVertex3f(x4 - x1, y4 - y1, 0);
 		GL.glEnd();
 
-		if (angle != 0) {
-			GL.glTranslatef(centerX, centerY, 0.0f);
-			GL.glRotatef(-angle, 0.0f, 0.0f, 1.0f);
-			GL.glTranslatef(-centerX, -centerY, 0.0f);
-		}
-		GL.glTranslatef(-x1, -y1, 0);
+//		if (angle != 0) {
+//			GL.glTranslatef(centerX, centerY, 0.0f);
+//			GL.glRotatef(-angle, 0.0f, 0.0f, 1.0f);
+//			GL.glTranslatef(-centerX, -centerY, 0.0f);
+//		}
+//		GL.glTranslatef(-x1, -y1, 0);
+GL.glPopMatrix();
+		texture.unbind();
 	}
 
 	/**
 		}
 		inUse = null;
 		GL.glEnd();
+		texture.unbind();
 	}
 
 	/**

trunk/Slick/src/org/newdawn/slick/UnicodeFont.java

 		CharSequence displayListKey = text.subSequence(startIndex, endIndex);
 
 		color.bind();
-		TextureImpl.bindNone();
+//		TextureImpl.bindNone();
 
 		DisplayList displayList = null;
 		if (displayListCaching && queuedGlyphs.isEmpty()) {

trunk/Slick/src/org/newdawn/slick/font/GlyphPage.java

 			}
 		}
 
-		TextureImpl.bindNone();
+//		TextureImpl.bindNone();
+		pageImage.unbind();
 
 		// Every other batch of glyphs added to a page are sorted the opposite way to attempt to keep same size glyps together.
 		orderAscending = !orderAscending;

trunk/Slick/src/org/newdawn/slick/geom/ShapeRenderer.java

      * @param shape The shape to draw.
      */
     public static final void draw(Shape shape) {
-        Texture t = TextureImpl.getLastBind();
-        TextureImpl.bindNone();
+//        Texture t = TextureImpl.getLastBind();
+//        TextureImpl.bindNone();
         
         float points[] = shape.getPoints();
         
         
         LSR.end();
         
-        if (t == null) {
-        	TextureImpl.bindNone();
-        } else {
-        	t.bind();
-        }
+//        if (t == null) {
+//        	TextureImpl.bindNone();
+//        } else {
+//        	t.bind();
+//        }
     }
 
     /**
     public static final void draw(Shape shape, ShapeFill fill) {
         float points[] = shape.getPoints();
         
-        Texture t = TextureImpl.getLastBind();
-        TextureImpl.bindNone();
+//        Texture t = TextureImpl.getLastBind();
+//        TextureImpl.bindNone();
 
         float center[] = shape.getCenter();
         GL.glBegin(SGL.GL_LINE_STRIP);
         }
         GL.glEnd();
         
-        if (t == null) {
-        	TextureImpl.bindNone();
-        } else {
-        	t.bind();
-        }
+//        if (t == null) {
+//        	TextureImpl.bindNone();
+//        } else {
+//        	t.bind();
+//        }
     }
     
     /**
     		return;
     	}
     	
-        Texture t = TextureImpl.getLastBind();
-        TextureImpl.bindNone();
+//        Texture t = TextureImpl.getLastBind();
+//        TextureImpl.bindNone();
         
     	fill(shape, new PointCallback() {
 			public float[] preRenderPoint(Shape shape, float x, float y) {
 			}
     	});
         
-        if (t == null) {
-        	TextureImpl.bindNone();
-        } else {
-        	t.bind();
-        }
+//        if (t == null) {
+//        	TextureImpl.bindNone();
+//        } else {
+//        	t.bind();
+//        }
     }
     
     /**
     		return;
     	}
     	
-    	final Texture t = TextureImpl.getLastBind();
-        image.getTexture().bind();
+//    	final Texture t = TextureImpl.getLastBind();
+//        image.getTexture().bind();
         
         fill(shape, new PointCallback() {
 			public float[] preRenderPoint(Shape shape, float x, float y) {
     	
         float points[] = shape.getPoints();
         
-        if (t == null) {
-        	TextureImpl.bindNone();
-        } else {
-        	t.bind();
-        }
+//        if (t == null) {
+//        	TextureImpl.bindNone();
+//        } else {
+//        	t.bind();
+//        }
     }
     
     /**
     	
         float points[] = shape.getPoints();
         
-        Texture t = TextureImpl.getLastBind();
-        image.getTexture().bind();
+//        Texture t = TextureImpl.getLastBind();
+//        image.getTexture().bind();
         
         final float minX = shape.getX();
         final float minY = shape.getY();
 			}
     	});
         
-        if (t == null) {
-        	TextureImpl.bindNone();
-        } else {
-        	t.bind();
-        }
+//        if (t == null) {
+//        	TextureImpl.bindNone();
+//        } else {
+//        	t.bind();
+//        }
     }
 
     /**
     		return;
     	}
         
-        Texture t = TextureImpl.getLastBind();
-        TextureImpl.bindNone();
+//        Texture t = TextureImpl.getLastBind();
+//        TextureImpl.bindNone();
 
         final float center[] = shape.getCenter();
         fill(shape, new PointCallback() {
 			}
     	});
         
-        if (t == null) {
-        	TextureImpl.bindNone();
-        } else {
-        	t.bind();
-        }
+//        if (t == null) {
+//        	TextureImpl.bindNone();
+//        } else {
+//        	t.bind();
+//        }
     }
     
 
     		return;
     	}
         
-        Texture t = TextureImpl.getLastBind();
-        image.getTexture().bind();
+//        Texture t = TextureImpl.getLastBind();
+//        image.getTexture().bind();
         
         final float center[] = shape.getCenter();
         fill(shape, new PointCallback() {
 			}
     	});
         
-        if (t == null) {
-        	TextureImpl.bindNone();
-        } else {
-        	t.bind();
-        }
+//        if (t == null) {
+//        	TextureImpl.bindNone();
+//        } else {
+//        	t.bind();
+//        }
     }
     /**
      * Draw the the given shape filled in with a texture.  Only the vertices are set.  
      * @param gen The texture coordinate generator to create coordiantes for the shape
      */
     public static final void texture(final Shape shape, Image image, final TexCoordGenerator gen) {
-        Texture t = TextureImpl.getLastBind();
+//        Texture t = TextureImpl.getLastBind();
 
         image.getTexture().bind();
 
 			}
     	});
         
-        if (t == null) {
-        	TextureImpl.bindNone();
-        } else {
-        	t.bind();
-        }
+//        if (t == null) {
+//        	TextureImpl.bindNone();
+//        } else {
+//        	t.bind();
+//        }
     }
     
     /**

trunk/Slick/src/org/newdawn/slick/opengl/InternalTextureLoader.java

 import java.nio.IntBuffer;
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.Map;
 
 import org.lwjgl.BufferUtils;
 import org.lwjgl.opengl.ContextCapabilities;
     public static boolean isPowerOfTwo(int n) {
         return (n & -n) == n;
     }
-
 	
     /**
      * Returns true if we are forcing loaded image data into power-of-two OpenGL textures (by default,
 	}
 	
     /** The table of textures that have been loaded in this loader */
-    private HashMap texturesLinear = new HashMap();
+    private Map texturesLinear = new HashMap();
     /** The table of textures that have been loaded in this loader */
-    private HashMap texturesNearest = new HashMap();
+    private Map texturesNearest = new HashMap();
     /** The destination pixel format */
     private int dstPixelFormat = SGL.GL_RGBA8;
     /** True if we're using deferred loading */
 	    	return new DeferredTexture(in, resourceName, flipped, filter, transparent);
 	    }
     	
-    	HashMap hash = texturesLinear;
+    	Map hash = texturesLinear;
         if (filter == SGL.GL_NEAREST) {
         	hash = texturesNearest;
         }
 
         int textureID = createTextureID();        
         TextureImpl texture = new TextureImpl(resourceName, target, textureID); 
-        // bind this texture 
-        GL.glEnable(target);
-        GL.glBindTexture(target, textureID); 
- 
+        // bind this texture
+//        GL.glEnable(target);
+//        GL.glBindTexture(target, textureID);
+        texture.bind();
+        
         int width;
         int height;
         int texWidth;
     	int textureID = createTextureID();        
         TextureImpl texture = new TextureImpl(ref, target, textureID); 
         // bind this texture 
-        GL.glEnable(target);
-        GL.glBindTexture(target, textureID); 
+//        GL.glEnable(target);
+//        GL.glBindTexture(target, textureID); 
+        texture.bind();
  
         int width = data.getWidth();
         int height = data.getHeight();
     	
         // create the texture ID for this texture 
         int textureID = createTextureID(); 
-        TextureImpl texture = new TextureImpl("generated:"+dataSource, target ,textureID); 
+        TextureImpl texture = new TextureImpl("generated:"+dataSource, target, textureID); 
         
         int minFilter = filter;
         int magFilter = filter;
-        boolean flipped = false;
+//        boolean flipped = false;
         
         // bind this texture 
-        GL.glEnable(target);
-        GL.glBindTexture(target, textureID); 
+//        GL.glEnable(target);
+//        GL.glBindTexture(target, textureID);
+        texture.bind();
     	
         int width;
         int height;
 			int minFilter, int magFilter, ByteBuffer textureBuffer) {
     	int target = SGL.GL_TEXTURE_2D;
         int textureID = createTextureID();
+        
         GL.glEnable(target);
         GL.glBindTexture(target, textureID); 
         

trunk/Slick/src/org/newdawn/slick/opengl/SlickCallable.java

 		
 		Renderer.get().flush();
 		lastUsed = TextureImpl.getLastBind();
-		TextureImpl.bindNone();
+//		TextureImpl.bindNone();
+		if (null != lastUsed) {
+			lastUsed.unbind();
+		}
 		GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
 		GL11.glPushClientAttrib(GL11.GL_ALL_CLIENT_ATTRIB_BITS);
 		GL11.glMatrixMode(GL11.GL_MODELVIEW);
 		
 		if (lastUsed != null) {
 			lastUsed.bind();
-		} else {
-			TextureImpl.bindNone();
+//		} else {
+//			TextureImpl.bindNone();
 		}
 		
 		inSafe = false;

trunk/Slick/src/org/newdawn/slick/opengl/Texture.java

 	 * @return The reference from which this texture was loaded
 	 */
 	public String getTextureRef();
-
+	
+	/**
+	 * unbinds texture (binds zero)
+	 */
+	public void unbind();
+	
 	/**
 	 * Bind the  GL context to a texture
 	 */

trunk/Slick/src/org/newdawn/slick/opengl/TextureImpl.java

 	protected static SGL GL = Renderer.get();
 	
 	/** The last texture that was bound to */
-	static Texture lastBind;
+	static Texture lastBind = null;
 	
 	/**
 	 * Retrieve the last texture bound through the texture interface
         this.target = target;
         this.ref = ref;
         this.textureID = textureID;
-        lastBind = this;
+//        lastBind = this;
     }
     
     /**
       format = imageFormat;
     }
     
-    /**
-     * Clear the binding of the texture
-     */
-    public static void bindNone() {
-    	lastBind = null;
-    	GL.glDisable(SGL.GL_TEXTURE_2D);
-    }
+//    /**
+//     * Clear the binding of the texture
+//     */
+//    public static void bindNone() {
+//    	lastBind = null;
+//    	GL.glDisable(SGL.GL_TEXTURE_2D);
+////    	GL.glBindTexture(SGL.GL_TEXTURE_2D, -1);
+//    }
     
     /**
      * Clear slick caching of the last bound texture so that an 
      * external texture binder can play with the context before returning 
      * control to slick.
      */
-    public static void unbind() {
+    public /*static*/ void unbind() {
     	lastBind = null;
+    	GL.glBindTexture(target, -1);
     }
     
     /**
     	InternalTextureLoader.deleteTextureID(textureID);
     	
         if (lastBind == this) {
-        	bindNone();
+        	unbind/*None*/();
         }
         
         if (cacheName != null) {
     public byte[] getTextureData() {
     	ByteBuffer buffer = BufferUtils.createByteBuffer(format.getColorComponents() * texWidth * texHeight);
     	bind();
-    	GL.glGetTexImage(SGL.GL_TEXTURE_2D, 0, format.getOGLType(), SGL.GL_UNSIGNED_BYTE,
-    					   buffer);
+    	GL.glGetTexImage(SGL.GL_TEXTURE_2D, 0, format.getOGLType(), SGL.GL_UNSIGNED_BYTE, buffer);
     	byte[] data = new byte[buffer.limit()];
     	buffer.get(data);
     	buffer.clear();

trunk/Slick/src/org/newdawn/slick/opengl/pbuffer/PBufferGraphics.java

 		// Put the renderer contents to the texture
 		GL.glBindTexture(GL11.GL_TEXTURE_2D, image.getTexture().getTextureID());
 		pbuffer.releaseTexImage(Pbuffer.FRONT_LEFT_BUFFER);
-		TextureImpl.unbind();
+//		TextureImpl.unbind();
+		GL.glBindTexture(GL11.GL_TEXTURE_2D, -1);
 		initGL();
 	}
 	

trunk/Slick/src/org/newdawn/slick/opengl/pbuffer/PBufferUniqueGraphics.java

 		}
 		
 		// Put the renderer contents to the texture
-		TextureImpl.unbind();
+//		TextureImpl.unbind();
 		initGL();
 	}
 	

trunk/Slick/src/org/newdawn/slick/particles/Particle.java

 	public void render() {
 		if ((engine.usePoints() && (usePoints == INHERIT_POINTS))
 				|| (usePoints == USE_POINTS)) {
-			TextureImpl.bindNone();
+//			TextureImpl.bindNone();
 			GL.glEnable(SGL.GL_POINT_SMOOTH);
 			GL.glPointSize(size / 2);
 			color.bind();

trunk/Slick/src/org/newdawn/slick/particles/ParticleSystem.java

 		}
 		if (usePoints()) {
 			GL.glEnable( SGL.GL_POINT_SMOOTH ); 
-			TextureImpl.bindNone();
+//			TextureImpl.bindNone();
 		}
 		
 		// iterate over all emitters

trunk/Slick/src/org/newdawn/slick/svg/SimpleDiagramRenderer.java

 		
 		GL.glCallList(list);
 		
-		TextureImpl.bindNone();
+//		TextureImpl.bindNone();
 	}
 	
 	/**

trunk/Slick/src/org/newdawn/slick/tests/GUITest.java

 package org.newdawn.slick.tests;
 
-import java.awt.event.KeyEvent;
-import java.lang.reflect.Field;
-import java.util.HashMap;
-
 import org.newdawn.slick.AngelCodeFont;
 import org.newdawn.slick.AppGameContainer;
 import org.newdawn.slick.BasicGame;
 import org.newdawn.slick.gui.TextField;
 import org.newdawn.slick.util.Log;
 
-
 /**
  * A test for the GUI components available in Slick. Very simple stuff
  *
 	 * @see org.newdawn.slick.BasicGame#render(org.newdawn.slick.GameContainer, org.newdawn.slick.Graphics)
 	 */
 	public void render(GameContainer container, Graphics g) {
-		background.draw(0, 0, 800, 500);
+		background.draw(0, 500, 800, -500);
 		
 		for (int i=0;i<4;i++) {
 			areas[i].render(container, g);
 		}
 	}
 	
-	
-	
 	/**
 	 * Entry point to our test
 	 * 
 	 * @see org.newdawn.slick.gui.ComponentListener#componentActivated(org.newdawn.slick.gui.AbstractComponent)
 	 */
 	public void componentActivated(AbstractComponent source) {
-		System.out.println("ACTIVL : "+source);
+		System.out.println("ACTIVE : "+source);
 		for (int i=0;i<4;i++) {
 			if (source == areas[i]) {
 				message = "Option "+(i+1)+" pressed!";
 			}
 		}
 		if (source == field2) {
+			message = "Field2 pressed";
 		}
 	}
 }

trunk/Slick/src/org/newdawn/slick/tests/TransitionTest.java

 		 * @see org.newdawn.slick.state.GameState#render(org.newdawn.slick.GameContainer, org.newdawn.slick.state.StateBasedGame, org.newdawn.slick.Graphics)
 		 */
 		public void render(GameContainer container, StateBasedGame game, Graphics g) throws SlickException {
-			image.draw(0,0,800,600);
+			image.draw(0,600,800,-600);
 			g.setColor(Color.red);
 			g.fillRect(-50,200,50,50);
 		}

trunk/Slick/src/org/newdawn/slick/util/BufferedImageUtil.java

 
 		// create the texture ID for this texture
 		int textureID = InternalTextureLoader.createTextureID();
-		TextureImpl.unbind();
+//		TextureImpl.unbind();
 		TextureImpl texture = new TextureImpl(resourceName, target, textureID);
 		
 		// Enable texturing