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


Java Renderer类代码示例

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


Renderer类属于org.newdawn.slick.opengl.renderer包,在下文中一共展示了Renderer类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: enterSafeBlock

import org.newdawn.slick.opengl.renderer.Renderer; //导入依赖的package包/类
/**
 * Enter a safe block ensuring that all the OpenGL state that slick 
 * uses is safe before touching the GL state directly.
 */
public static void enterSafeBlock() 
{
	if (inSafe) {
		return;
	}
	
	Renderer.get().flush();
	lastUsed = TextureImpl.getLastBind();
	TextureImpl.bindNone();
	GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
	GL11.glPushClientAttrib(GL11.GL_ALL_CLIENT_ATTRIB_BITS);
	GL11.glMatrixMode(GL11.GL_MODELVIEW);
	GL11.glPushMatrix();
	GL11.glMatrixMode(GL11.GL_PROJECTION);
	GL11.glPushMatrix();
	GL11.glMatrixMode(GL11.GL_MODELVIEW);
	
	inSafe = true;
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:24,代码来源:SlickCallable.java

示例2: enterSafeBlock

import org.newdawn.slick.opengl.renderer.Renderer; //导入依赖的package包/类
/**
 * Enter a safe block ensuring that all the OpenGL state that slick
 * uses is safe before touching the GL state directly.
 */
public static void enterSafeBlock()
{
    if (inSafe) {
        return;
    }

    Renderer.get().flush();
    lastUsed = TextureImpl.getLastBind();
    TextureImpl.bindNone();
    GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
    GL11.glPushClientAttrib(GL11.GL_ALL_CLIENT_ATTRIB_BITS);
    GL11.glMatrixMode(GL11.GL_MODELVIEW);
    GL11.glPushMatrix();
    GL11.glMatrixMode(GL11.GL_PROJECTION);
    GL11.glPushMatrix();
    GL11.glMatrixMode(GL11.GL_MODELVIEW);

    inSafe = true;
}
 
开发者ID:FOShameDotOrg,项目名称:fuzzy-octo-shame,代码行数:24,代码来源:SlickCallable.java

示例3: checkGLContext

import org.newdawn.slick.opengl.renderer.Renderer; //导入依赖的package包/类
/**
 * Check that we're in the right place to be doing GL operations
 */
public static void checkGLContext() {
       try {
       	Renderer.get().glGetError();
       } catch (NullPointerException e) {
       	throw new RuntimeException("OpenGL based resources (images, fonts, sprites etc) must be loaded as part of init() or the game loop. They cannot be loaded before initialisation.");
       }
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:11,代码来源:GLUtils.java

示例4: main

import org.newdawn.slick.opengl.renderer.Renderer; //导入依赖的package包/类
/**
 * Entry point to our test
 * 
 * @param argv The arguments to pass into the test
 */
public static void main(String[] argv) {
	try {
		Renderer.setRenderer(Renderer.VERTEX_ARRAY_RENDERER);
		
		AppGameContainer container = new AppGameContainer(new GradientTest());
		container.setDisplayMode(800,600,false);
		container.start();
	} catch (SlickException e) {
		e.printStackTrace();
	}
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:17,代码来源:GradientTest.java

示例5: main

import org.newdawn.slick.opengl.renderer.Renderer; //导入依赖的package包/类
/**
 * Entry point to our test
 * 
 * @param argv The arguments passed to the test
 */
public static void main(String[] argv) {
	try {
		Renderer.setRenderer(Renderer.VERTEX_ARRAY_RENDERER);
		
		AppGameContainer container = new AppGameContainer(new GeomTest());
		container.setDisplayMode(800,600,false);
		container.start();
	} catch (SlickException e) {
		e.printStackTrace();
	}
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:17,代码来源:GeomTest.java

示例6: main

import org.newdawn.slick.opengl.renderer.Renderer; //导入依赖的package包/类
/**
 * Entry point to our test
 * 
 * @param argv The arguments passed to the test
 */
public static void main(String[] argv) {
    try {
    	Renderer.setRenderer(Renderer.VERTEX_ARRAY_RENDERER);
        AppGameContainer container = new AppGameContainer(new ShapeTest());
        container.setDisplayMode(800,600,false);
        container.start();
    } catch (SlickException e) {
        e.printStackTrace();
    }
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:16,代码来源:ShapeTest.java

示例7: main

import org.newdawn.slick.opengl.renderer.Renderer; //导入依赖的package包/类
/**
 * Entry point to our simple test
 * 
 * @param argv The arguments passed in
 */
public static void main(String argv[]) {
	try {
		Renderer.setRenderer(Renderer.VERTEX_ARRAY_RENDERER);
		Renderer.setLineStripRenderer(Renderer.QUAD_BASED_LINE_STRIP_RENDERER);
		
		AppGameContainer container = new AppGameContainer(new InkscapeTest());
		container.setDisplayMode(800,600,false);
		container.start();
	} catch (SlickException e) {
		e.printStackTrace();
	}
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:18,代码来源:InkscapeTest.java

示例8: main

import org.newdawn.slick.opengl.renderer.Renderer; //导入依赖的package包/类
/**
 * Entry point to our test
 * 
 * @param argv The arguments passed to the test
 */
public static void main(String[] argv) {
	try {
		Renderer.setLineStripRenderer(Renderer.QUAD_BASED_LINE_STRIP_RENDERER);
		Renderer.getLineStripRenderer().setLineCaps(true);
		
		AppGameContainer container = new AppGameContainer(new LineRenderTest());
		container.setDisplayMode(800,600,false);
		container.start();
	} catch (SlickException e) {
		e.printStackTrace();
	}
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:18,代码来源:LineRenderTest.java

示例9: resetLineWidth

import org.newdawn.slick.opengl.renderer.Renderer; //导入依赖的package包/类
/**
 * Reset the line width in use to the default for this graphics context
 */
public void resetLineWidth() {
	predraw();
	
	Renderer.getLineStripRenderer().setWidth(1.0f);
	GL.glLineWidth(1.0f);
	GL.glPointSize(1.0f);
	
	postdraw();
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:13,代码来源:Graphics.java

示例10: resetLineWidth

import org.newdawn.slick.opengl.renderer.Renderer; //导入依赖的package包/类
/**
 * Reset the line width in use to the default for this graphics context
 */
public void resetLineWidth() {
    predraw();

    Renderer.getLineStripRenderer().setWidth(1.0f);
    GL.glLineWidth(1.0f);
    GL.glPointSize(1.0f);

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

示例11: apply

import org.newdawn.slick.opengl.renderer.Renderer; //导入依赖的package包/类
/**
 * Uploads the pixel data to the given texture at the specified position.
 * This only needs to be called once, after the pixel data has changed.
 * 
 * @param texture the texture to modify
 * @param x the x position to place the pixel data on the texture
 * @param y the y position to place the pixel data on the texture
 */
public void apply(Texture texture, int x, int y) {
	if (x+width > texture.getTextureWidth() || y+height > texture.getTextureHeight())
		throw new IndexOutOfBoundsException("pixel data won't fit in given texture");
	position(length());
	pixels.flip();
	int glFmt = format.getOGLType();
	final SGL GL = Renderer.get();
	texture.bind();
	GL.glTexSubImage2D(SGL.GL_TEXTURE_2D, 0, x, y, width, height, 
			glFmt, SGL.GL_UNSIGNED_BYTE, pixels);
}
 
开发者ID:lucas-tulio,项目名称:fractal-explorer,代码行数:20,代码来源:PixelData.java


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