本文整理汇总了Java中org.newdawn.slick.opengl.TextureImpl.getLastBind方法的典型用法代码示例。如果您正苦于以下问题:Java TextureImpl.getLastBind方法的具体用法?Java TextureImpl.getLastBind怎么用?Java TextureImpl.getLastBind使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.newdawn.slick.opengl.TextureImpl
的用法示例。
在下文中一共展示了TextureImpl.getLastBind方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
}
示例2: 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(@Nonnull 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();
}
}
示例3: 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();
}
}
示例4: 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();
}
}
示例5: textureFit
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. This method is required to
* fit the texture scaleX times across the shape and scaleY times down the shape.
*
* @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
*/
public static final void textureFit(@Nonnull Shape shape, @Nonnull final Image image, final float scaleX, final float scaleY) {
if (!validFill(shape)) {
return;
}
shape.getPoints();
Texture t = TextureImpl.getLastBind();
image.getTexture().bind();
shape.getX();
shape.getY();
shape.getMaxX();
shape.getMaxY();
fill(shape, (shape1, x, y) -> {
x -= shape1.getMinX();
y -= shape1.getMinY();
x /= (shape1.getMaxX() - shape1.getMinX());
y /= (shape1.getMaxY() - shape1.getMinY());
float tx = x * scaleX;
float ty = y * scaleY;
tx = image.getTextureOffsetX() + (image.getTextureWidth() * tx);
ty = image.getTextureOffsetY() + (image.getTextureHeight() * ty);
GL.glTexCoord2f(tx, ty);
return null;
});
if (t == null) {
TextureImpl.bindNone();
} else {
t.bind();
}
}
示例6: getLastBind
import org.newdawn.slick.opengl.TextureImpl; //导入方法依赖的package包/类
public static Texture getLastBind()
{
return TextureImpl.getLastBind();
}