本文整理汇总了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;
}
示例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;
}
示例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.");
}
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
示例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();
}
示例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();
}
示例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);
}