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


Java TextureImpl类代码示例

本文整理汇总了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();
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:25,代码来源:PBufferGraphics.java

示例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();
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:24,代码来源:PBufferUniqueGraphics.java

示例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();
    }
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:30,代码来源:ShapeRenderer.java

示例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();
}
 
开发者ID:FOShameDotOrg,项目名称:fuzzy-octo-shame,代码行数:25,代码来源:PBufferGraphics.java

示例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();
}
 
开发者ID:FOShameDotOrg,项目名称:fuzzy-octo-shame,代码行数:24,代码来源:PBufferUniqueGraphics.java

示例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();
    }
}
 
开发者ID:FOShameDotOrg,项目名称:fuzzy-octo-shame,代码行数:30,代码来源:ShapeRenderer.java

示例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();
    }
}
 
开发者ID:FOShameDotOrg,项目名称:fuzzy-octo-shame,代码行数:23,代码来源:ShapeRenderer.java

示例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();
    }
}
 
开发者ID:FOShameDotOrg,项目名称:fuzzy-octo-shame,代码行数:28,代码来源:ShapeRenderer.java

示例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);
}
 
开发者ID:Piratkopia13,项目名称:Pixel-Planet,代码行数:17,代码来源:Network.java

示例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();
        }
}
 
开发者ID:Periapsis,项目名称:aphelion,代码行数:20,代码来源:Camera.java

示例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();
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:19,代码来源:SimpleDiagramRenderer.java

示例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);
	}
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:36,代码来源:Particle.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(Shape shape, ShapeFill fill) {
	predraw();
	TextureImpl.bindNone();

	ShapeRenderer.draw(shape, fill);

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

示例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();
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:16,代码来源:Graphics.java

示例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();
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:29,代码来源:Graphics.java


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