当前位置: 首页>>代码示例>>Java>>正文


Java TextureImpl.bindNone方法代码示例

本文整理汇总了Java中org.newdawn.slick.opengl.TextureImpl.bindNone方法的典型用法代码示例。如果您正苦于以下问题:Java TextureImpl.bindNone方法的具体用法?Java TextureImpl.bindNone怎么用?Java TextureImpl.bindNone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.newdawn.slick.opengl.TextureImpl的用法示例。


在下文中一共展示了TextureImpl.bindNone方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: draw

import org.newdawn.slick.opengl.TextureImpl; //导入方法依赖的package包/类
/**
 * Draw the outline of the given shape.  Only the vertices are set.  
 * The colour has to be set independently of this method.
 * 
 * @param shape The shape to draw.
 */
public static final void draw(Shape shape) {
    Texture t = TextureImpl.getLastBind();
    TextureImpl.bindNone();
    
    float points[] = shape.getPoints();
    
    LSR.start();
    for(int i=0;i<points.length;i+=2) {
    	LSR.vertex(points[i], points[i + 1]);
    }
    
    if (shape.closed()) {
    	LSR.vertex(points[0], points[1]);
    }
    
    LSR.end();
    
    if (t == null) {
    	TextureImpl.bindNone();
    } else {
    	t.bind();
    }
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:30,代码来源:ShapeRenderer.java

示例2: fill

import org.newdawn.slick.opengl.TextureImpl; //导入方法依赖的package包/类
/**
 * Draw the the given shape filled in.  Only the vertices are set.  
 * The colour has to be set independently of this method.
 * 
 * @param shape The shape to fill.
 */
public static final void fill(@Nonnull Shape shape) {
    if (!validFill(shape)) {
        return;
    }

    Texture t = TextureImpl.getLastBind();
    TextureImpl.bindNone();
    
    fill(shape, (shape1, x, y) -> null);
    
    if (t == null) {
        TextureImpl.bindNone();
    } else {
        t.bind();
    }
}
 
开发者ID:FOShameDotOrg,项目名称:fuzzy-octo-shame,代码行数:23,代码来源:ShapeRenderer.java

示例3: texture

import org.newdawn.slick.opengl.TextureImpl; //导入方法依赖的package包/类
/**
 * Draw the the given shape filled in with a texture.  Only the vertices are set.  
 * The colour has to be set independently of this method.
 * 
 * @param shape The shape to texture.
 * @param image The image to tile across the shape
 * @param gen The texture coordinate generator to create coordiantes for the shape
 */
public static final void texture(@Nonnull final Shape shape, @Nonnull Image image, @Nonnull final TexCoordGenerator gen) {
    Texture t = TextureImpl.getLastBind();

    image.getTexture().bind();

    shape.getCenter();
    fill(shape, (shape1, x, y) -> {
        Vector2f tex = gen.getCoordFor(x, y);
        GL.glTexCoord2f(tex.x, tex.y);

        return new float[] {x,y};
    });
    
    if (t == null) {
        TextureImpl.bindNone();
    } else {
        t.bind();
    }
}
 
开发者ID:FOShameDotOrg,项目名称:fuzzy-octo-shame,代码行数:28,代码来源:ShapeRenderer.java

示例4: draw

import org.newdawn.slick.opengl.TextureImpl; //导入方法依赖的package包/类
/**
 * Draw the outline of the given shape.
 * 
 * @param shape
 *            The shape to draw.
 * @param fill
 *            The fill type to apply
 */
public void draw(Shape shape, ShapeFill fill) {
	predraw();
	TextureImpl.bindNone();

	ShapeRenderer.draw(shape, fill);

	currentColor.bind();
	postdraw();
}
 
开发者ID:IngSW-unipv,项目名称:Progetto-C,代码行数:18,代码来源:Graphics.java

示例5: draw

import org.newdawn.slick.opengl.TextureImpl; //导入方法依赖的package包/类
/**
 * Draw the outline of the given shape.
 * 
 * @param shape
 *            The shape to draw.
 */
public void draw(Shape shape) {
	predraw();
	TextureImpl.bindNone();
	currentColor.bind();

	ShapeRenderer.draw(shape);

	postdraw();
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:16,代码来源:Graphics.java

示例6: fill

import org.newdawn.slick.opengl.TextureImpl; //导入方法依赖的package包/类
/**
 * Draw the the given shape filled in.
 * 
 * @param shape
 *            The shape to fill.
 */
public void fill(Shape shape) {
	predraw();
	TextureImpl.bindNone();
	currentColor.bind();

	ShapeRenderer.fill(shape);

	postdraw();
}
 
开发者ID:IngSW-unipv,项目名称:Progetto-C,代码行数:16,代码来源:Graphics.java

示例7: drawArc

import org.newdawn.slick.opengl.TextureImpl; //导入方法依赖的package包/类
/**
 * Draw an oval to the canvas
 * 
 * @param x1
 *            The x coordinate of the top left corner of a box containing
 *            the arc
 * @param y1
 *            The y coordinate of the top left corner of a box containing
 *            the arc
 * @param width
 *            The width of the arc
 * @param height
 *            The height of the arc
 * @param segments
 *            The number of line segments to use when drawing the arc
 * @param start
 *            The angle the arc starts at
 * @param end
 *            The angle the arc ends at
 */
public void drawArc(float x1, float y1, float width, float height,
		int segments, float start, float end) {
	predraw();
	TextureImpl.bindNone();
	currentColor.bind();

	while (end < start) {
		end += 360;
	}

	float cx = x1 + (width / 2.0f);
	float cy = y1 + (height / 2.0f);

	LSR.start();
	int step = 360 / segments;

	for (int a = (int) start; a < (int) (end + step); a += step) {
		float ang = a;
		if (ang > end) {
			ang = end;
		}
		float x = (float) (cx + (FastTrig.cos(Math.toRadians(ang)) * width / 2.0f));
		float y = (float) (cy + (FastTrig.sin(Math.toRadians(ang)) * height / 2.0f));

		LSR.vertex(x,y);
	}
	LSR.end();
	postdraw();
}
 
开发者ID:IngSW-unipv,项目名称:Progetto-C,代码行数:50,代码来源:Graphics.java

示例8: fillRect

import org.newdawn.slick.opengl.TextureImpl; //导入方法依赖的package包/类
/**
 * Fill a rectangle on the canvas in the current color
 * 
 * @param x1
 *            The x coordinate of the top left corner
 * @param y1
 *            The y coordinate of the top left corner
 * @param width
 *            The width of the rectangle to fill
 * @param height
 *            The height of the rectangle to fill
 */
public void fillRect(float x1, float y1, float width, float height) {
	predraw();
	TextureImpl.bindNone();
	currentColor.bind();

	GL.glBegin(SGL.GL_QUADS);
	GL.glVertex2f(x1, y1);
	GL.glVertex2f(x1 + width, y1);
	GL.glVertex2f(x1 + width, y1 + height);
	GL.glVertex2f(x1, y1 + height);
	GL.glEnd();
	postdraw();
}
 
开发者ID:IngSW-unipv,项目名称:Progetto-C,代码行数:26,代码来源:Graphics.java

示例9: texture

import org.newdawn.slick.opengl.TextureImpl; //导入方法依赖的package包/类
/**
 * Draw the the given shape filled in with a texture
 * 
 * @param shape
 *            The shape to texture.
 * @param image
 *            The image to tile across the shape
 * @param scaleX
 *            The scale to apply on the x axis for texturing
 * @param scaleY
 *            The scale to apply on the y axis for texturing
 * @param fit
 *            True if we want to fit the image on to the shape
 */
public void texture(Shape shape, Image image, float scaleX, float scaleY,
		boolean fit) {
	predraw();
	TextureImpl.bindNone();
	currentColor.bind();

	if (fit) {
		ShapeRenderer.textureFit(shape, image, scaleX, scaleY);
	} else {
		ShapeRenderer.texture(shape, image, scaleX, scaleY);
	}
	
	postdraw();
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:29,代码来源:Graphics.java

示例10: render

import org.newdawn.slick.opengl.TextureImpl; //导入方法依赖的package包/类
/**
 * Render the diagram to the given graphics context
 * 
 * @param g The graphics context to which we should render the diagram
 */
public void render(Graphics g) {
	// last list generation
	if (list == -1) {
		list = GL.glGenLists(1);
		GL.glNewList(list, SGL.GL_COMPILE);
			render(g, diagram);
		GL.glEndList();
	}
	
	GL.glCallList(list);
	
	TextureImpl.bindNone();
}
 
开发者ID:IngSW-unipv,项目名称:Progetto-C,代码行数:19,代码来源:SimpleDiagramRenderer.java

示例11: render

import org.newdawn.slick.opengl.TextureImpl; //导入方法依赖的package包/类
/**
 * Render this particle
 */
public void render() {
	if ((engine.usePoints() && (usePoints == INHERIT_POINTS))
			|| (usePoints == USE_POINTS)) {
		TextureImpl.bindNone();
		GL.glEnable(SGL.GL_POINT_SMOOTH);
		GL.glPointSize(size / 2);
		color.bind();
		GL.glBegin(SGL.GL_POINTS);
		GL.glVertex2f(x, y);
		GL.glEnd();
	} else if (oriented || scaleY != 1.0f) {
		GL.glPushMatrix();

		GL.glTranslatef(x, y, 0f);

		if (oriented) {
			float angle = (float) (Math.atan2(y, x) * 180 / Math.PI);
			GL.glRotatef(angle, 0f, 0f, 1.0f);
		}

		// scale
		GL.glScalef(1.0f, scaleY, 1.0f);

		image.draw((int) (-(size / 2)), (int) (-(size / 2)), (int) size,
				(int) size, color);
		GL.glPopMatrix();
	} else {
		color.bind();
		image.drawEmbedded((int) (x - (size / 2)), (int) (y - (size / 2)),
				(int) size, (int) size);
	}
}
 
开发者ID:IngSW-unipv,项目名称:Progetto-C,代码行数:36,代码来源:Particle.java

示例12: draw

import org.newdawn.slick.opengl.TextureImpl; //导入方法依赖的package包/类
@Override
public void draw() {
    super.draw();

    UIUtils.drawQuad(
            new PosXY(bottomRightPx.x, topLeftPx.y),
            new PosXY(bottomRightPx.x, topLeftPx.y + 16),
            new PosXY(bottomRightPx.x + 38, topLeftPx.y + 16),
            new PosXY(bottomRightPx.x + 62, topLeftPx.y),
            backgroundColor
    );

    UIUtils.drawQuad(
            new PosXY(topLeftPx.x - 62, topLeftPx.y),
            new PosXY(topLeftPx.x - 38, topLeftPx.y + 16),
            new PosXY(topLeftPx.x, topLeftPx.y + 16),
            topLeftPx,
            backgroundColor
    );

    UIColor textCol = UIColor.matWhite();
    //Right text
    font.drawString((float) bottomRightPx.x, (float) topLeftPx.y, rightText, new Color((float) textCol.r, (float) textCol.g, (float) textCol.b, (float) textCol.a));
    //Left text
    font.drawString((float) topLeftPx.x - 40, (float) topLeftPx.y, leftText, new Color((float) textCol.r, (float) textCol.g, (float) textCol.b, (float) textCol.a));
    TextureImpl.bindNone();
}
 
开发者ID:CraftedCart,项目名称:SMBLevelWorkshop,代码行数:28,代码来源:TimelinePlayhead.java

示例13: draw

import org.newdawn.slick.opengl.TextureImpl; //导入方法依赖的package包/类
/**
 * Draw the outline of the given shape.
 *
 * @param shape
 *            The shape to draw.
 * @param fill
 *            The fill type to apply
 */
public void draw(@Nonnull Shape shape, @Nonnull ShapeFill fill) {
    predraw();
    TextureImpl.bindNone();

    ShapeRenderer.draw(shape, fill);

    currentColor.bind();
    postdraw();
}
 
开发者ID:FOShameDotOrg,项目名称:fuzzy-octo-shame,代码行数:18,代码来源:Graphics.java

示例14: fillRect

import org.newdawn.slick.opengl.TextureImpl; //导入方法依赖的package包/类
/**
 * Fill a rectangle on the canvas in the current color
 *
 * @param x1
 *            The x coordinate of the top left corner
 * @param y1
 *            The y coordinate of the top left corner
 * @param width
 *            The width of the rectangle to fill
 * @param height
 *            The height of the rectangle to fill
 */
void fillRect(float x1, float y1, float width, float height) {
    predraw();
    TextureImpl.bindNone();
    currentColor.bind();

    GL.glBegin(SGL.GL_QUADS);
    GL.glVertex2f(x1, y1);
    GL.glVertex2f(x1 + width, y1);
    GL.glVertex2f(x1 + width, y1 + height);
    GL.glVertex2f(x1, y1 + height);
    GL.glEnd();
    postdraw();
}
 
开发者ID:FOShameDotOrg,项目名称:fuzzy-octo-shame,代码行数:26,代码来源:Graphics.java

示例15: drawString

import org.newdawn.slick.opengl.TextureImpl; //导入方法依赖的package包/类
public static void drawString(double x, double y, String string) {
	glPushMatrix();
	glScaled(1, -1, 1);
	glTranslated(0, -18 + -2 * y, 0);
	TextureImpl.bindNone();
	Color fontColour = Colour.getCurrentColour();
	font.drawString((float)x, (float)y, string, fontColour);
	TextureImpl.unbind();
	glDisable(GL_TEXTURE_2D);
	glPopMatrix();
}
 
开发者ID:bartvbl,项目名称:pixeltoy,代码行数:12,代码来源:GraphicsController.java


注:本文中的org.newdawn.slick.opengl.TextureImpl.bindNone方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。