本文整理汇总了Java中org.newdawn.slick.opengl.TextureImpl类的典型用法代码示例。如果您正苦于以下问题:Java TextureImpl类的具体用法?Java TextureImpl怎么用?Java TextureImpl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TextureImpl类属于org.newdawn.slick.opengl包,在下文中一共展示了TextureImpl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: enable
import org.newdawn.slick.opengl.TextureImpl; //导入依赖的package包/类
/**
* @see org.newdawn.slick.Graphics#enable()
*/
protected void enable() {
SlickCallable.enterSafeBlock();
try {
if (pbuffer.isBufferLost()) {
pbuffer.destroy();
init();
}
pbuffer.makeCurrent();
} catch (Exception e) {
Log.error("Failed to recreate the PBuffer");
throw new RuntimeException(e);
}
// Put the renderer contents to the texture
GL.glBindTexture(GL11.GL_TEXTURE_2D, image.getTexture().getTextureID());
pbuffer.releaseTexImage(Pbuffer.FRONT_LEFT_BUFFER);
TextureImpl.unbind();
initGL();
}
示例2: enable
import org.newdawn.slick.opengl.TextureImpl; //导入依赖的package包/类
/**
* @see org.newdawn.slick.Graphics#enable()
*/
protected void enable() {
SlickCallable.enterSafeBlock();
try {
if (pbuffer.isBufferLost()) {
pbuffer.destroy();
init();
}
pbuffer.makeCurrent();
} catch (Exception e) {
Log.error("Failed to recreate the PBuffer");
Log.error(e);
throw new RuntimeException(e);
}
// Put the renderer contents to the texture
TextureImpl.unbind();
initGL();
}
示例3: 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();
}
}
示例4: enable
import org.newdawn.slick.opengl.TextureImpl; //导入依赖的package包/类
/**
* @see org.newdawn.slick.Graphics#enable()
*/
protected void enable() {
SlickCallable.enterSafeBlock();
try {
if (pbuffer.isBufferLost()) {
pbuffer.destroy();
init();
}
pbuffer.makeCurrent();
} catch (Exception e) {
Log.error("Failed to recreate the PBuffer");
throw new RuntimeException(e);
}
// Put the renderer contents to the texture
GL.glBindTexture(GL11.GL_TEXTURE_2D, image.getTexture().getTextureID());
pbuffer.releaseTexImage(Pbuffer.FRONT_LEFT_BUFFER);
TextureImpl.unbind();
initGL();
}
示例5: enable
import org.newdawn.slick.opengl.TextureImpl; //导入依赖的package包/类
/**
* @see org.newdawn.slick.Graphics#enable()
*/
protected void enable() {
SlickCallable.enterSafeBlock();
try {
if (pbuffer.isBufferLost()) {
pbuffer.destroy();
init();
}
pbuffer.makeCurrent();
} catch (Exception e) {
Log.error("Failed to recreate the PBuffer");
Log.error(e);
throw new RuntimeException(e);
}
// Put the renderer contents to the texture
TextureImpl.unbind();
initGL();
}
示例6: 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();
}
}
示例7: 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();
}
}
示例8: 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();
}
}
示例9: registerClasses
import org.newdawn.slick.opengl.TextureImpl; //导入依赖的package包/类
private void registerClasses(Kryo kryo){
kryo.register(float[].class);
kryo.register(int[].class);
kryo.register(HashMap.class);
kryo.register(String[].class);
kryo.register(String[][].class);
kryo.register(ArrayList.class);
kryo.register(Player.class);
kryo.register(Image.class);
kryo.register(byte[].class);
kryo.register(TextureImpl.class);
kryo.register(Point2D.Float.class);
kryo.register(NetworkFormat.class);
kryo.register(List.class);
kryo.register(Chat.class);
}
示例10: renderPlayerText
import org.newdawn.slick.opengl.TextureImpl; //导入依赖的package包/类
public void renderPlayerText(@Nonnull String text, int x, int y, @Nonnull Color color)
{
if (playerFont == null || nifty == null)
{
// Without nifty, use slick with its default font
Graph.g.setColor(new org.newdawn.slick.Color(color.getRed(), color.getGreen(), color.getBlue(), color.getAlpha()));
Graph.g.drawString(text, x, y);
}
else
{
TextureImpl.unbind();
nifty.getRenderEngine().setColor(color);
nifty.getRenderEngine().setFont(playerFont);
nifty.getRenderEngine().renderText(text, x, y, -1, -1, Color.NONE);
nifty.getRenderEngine().setColor(Color.WHITE);
Graph.g.setColor(org.newdawn.slick.Color.white);
TextureImpl.unbind();
}
}
示例11: 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();
}
示例12: 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);
}
}
示例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(Shape shape, ShapeFill fill) {
predraw();
TextureImpl.bindNone();
ShapeRenderer.draw(shape, fill);
currentColor.bind();
postdraw();
}
示例14: 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();
}
示例15: 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();
}