@Override
	public void drawRect(int fbo, int texId, BlendMode mode, double startX,
			double startY, double endX, double endY, double texStartX,
			double texStartY, double texEndX, double texEndY, Color c,
			double transparency) {
		bindRenderTarget(fbo);

		glColor4f((float) c.getRed(), (float) c.getGreen(),
				(float) c.getBlue(), (float) (c.getAlpha() * transparency));

		switch (mode) {
		case ADD_LIGHT:
			glBlendFunc(GL_ONE, GL_ONE);
			break;
		case APPLY_LIGHT:
			glBlendFunc(GL_DST_COLOR, GL_ZERO);
			break;
		case SPRITE:
			glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
			break;
		}
		bindTexture(texId);

		glBegin(GL_TRIANGLE_FAN);
		{
			glTexCoord2f((float) texStartX, (float) texStartY);
			glVertex2f((float) startX, (float) startY);
			glTexCoord2f((float) texStartX, (float) texEndY);
			glVertex2f((float) startX, (float) endY);
			glTexCoord2f((float) texEndX, (float) texEndY);
			glVertex2f((float) endX, (float) endY);
			glTexCoord2f((float) texEndX, (float) texStartY);
			glVertex2f((float) endX, (float) startY);
		}
		glEnd();
	}