Java 类org.lwjgl.opengl.RenderTexture 实例源码

项目:trashjam2017    文件:PBufferGraphics.java   
/**
 * Initialise the PBuffer that will be used to render to
 * 
 * @throws SlickException
 */
private void init() throws SlickException {
    try {
        Texture tex = InternalTextureLoader.get().createTexture(image.getWidth(), image.getHeight(), image.getFilter());

        final RenderTexture rt = new RenderTexture(false, true, false, false, RenderTexture.RENDER_TEXTURE_2D, 0);
        pbuffer = new Pbuffer(screenWidth, screenHeight, new PixelFormat(8, 0, 0), rt, null);

        // Initialise state of the pbuffer context.
        pbuffer.makeCurrent();

        initGL();
        GL.glBindTexture(GL11.GL_TEXTURE_2D, tex.getTextureID());
        pbuffer.releaseTexImage(Pbuffer.FRONT_LEFT_BUFFER);
        image.draw(0,0);
        image.setTexture(tex);

        Display.makeCurrent();
    } catch (Exception e) {
        Log.error(e);
        throw new SlickException("Failed to create PBuffer for dynamic image. OpenGL driver failure?");
    }
}
项目:Progetto-C    文件:PBufferGraphics.java   
/**
 * Initialise the PBuffer that will be used to render to
 * 
 * @throws SlickException
 */
private void init() throws SlickException {
    try {
        Texture tex = InternalTextureLoader.get().createTexture(image.getWidth(), image.getHeight(), image.getFilter());

        final RenderTexture rt = new RenderTexture(false, true, false, false, RenderTexture.RENDER_TEXTURE_2D, 0);
        pbuffer = new Pbuffer(screenWidth, screenHeight, new PixelFormat(8, 0, 0), rt, null);

        // Initialise state of the pbuffer context.
        pbuffer.makeCurrent();

        initGL();
        GL.glBindTexture(GL11.GL_TEXTURE_2D, tex.getTextureID());
        pbuffer.releaseTexImage(Pbuffer.FRONT_LEFT_BUFFER);
        image.draw(0,0);
        image.setTexture(tex);

        Display.makeCurrent();
    } catch (Exception e) {
        Log.error(e);
        throw new SlickException("Failed to create PBuffer for dynamic image. OpenGL driver failure?");
    }
}
项目:BaseClient    文件:PBufferGraphics.java   
/**
 * Initialise the PBuffer that will be used to render to
 * 
 * @throws SlickException
 */
private void init() throws SlickException {
    try {
        Texture tex = InternalTextureLoader.get().createTexture(image.getWidth(), image.getHeight(), image.getFilter());

        final RenderTexture rt = new RenderTexture(false, true, false, false, RenderTexture.RENDER_TEXTURE_2D, 0);
        pbuffer = new Pbuffer(screenWidth, screenHeight, new PixelFormat(8, 0, 0), rt, null);

        // Initialise state of the pbuffer context.
        pbuffer.makeCurrent();

        initGL();
        GL.glBindTexture(GL11.GL_TEXTURE_2D, tex.getTextureID());
        pbuffer.releaseTexImage(Pbuffer.FRONT_LEFT_BUFFER);
        image.draw(0,0);
        image.setTexture(tex);

        Display.makeCurrent();
    } catch (Exception e) {
        Log.error(e);
        throw new SlickException("Failed to create PBuffer for dynamic image. OpenGL driver failure?");
    }
}
项目:code404    文件:PBufferGraphics.java   
/**
 * Initialise the PBuffer that will be used to render to
 * 
 * @throws SlickException
 */
private void init() throws SlickException {
    try {
        Texture tex = InternalTextureLoader.get().createTexture(image.getWidth(), image.getHeight(), image.getFilter());

        final RenderTexture rt = new RenderTexture(false, true, false, false, RenderTexture.RENDER_TEXTURE_2D, 0);
        pbuffer = new Pbuffer(screenWidth, screenHeight, new PixelFormat(8, 0, 0), rt, null);

        // Initialise state of the pbuffer context.
        pbuffer.makeCurrent();

        initGL();
        GL.glBindTexture(GL11.GL_TEXTURE_2D, tex.getTextureID());
        pbuffer.releaseTexImage(Pbuffer.FRONT_LEFT_BUFFER);
        image.draw(0,0);
        image.setTexture(tex);

        Display.makeCurrent();
    } catch (Exception e) {
        Log.error(e);
        throw new SlickException("Failed to create PBuffer for dynamic image. OpenGL driver failure?");
    }
}
项目:fuzzy-octo-shame    文件:PBufferGraphics.java   
/**
 * Initialise the PBuffer that will be used to render to
 *
 * @throws SlickException
 */
private void init() throws SlickException {
    try {
        Texture tex = InternalTextureLoader.get().createTexture(image.getWidth(), image.getHeight(), image.getFilter());

        final RenderTexture rt = new RenderTexture(false, true, false, false, RenderTexture.RENDER_TEXTURE_2D, 0);
        pbuffer = new Pbuffer(screenWidth, screenHeight, new PixelFormat(8, 0, 0), rt, null);

        // Initialise state of the pbuffer context.
        pbuffer.makeCurrent();

        initGL();
        GL.glBindTexture(GL11.GL_TEXTURE_2D, tex.getTextureID());
        pbuffer.releaseTexImage(Pbuffer.FRONT_LEFT_BUFFER);

        if (image.getTexture()!=null)
            image.draw(0,0);
        Graphics.setCurrent(this); //this means you need to call flush() after getGraphics()
        image.setTexture(tex);

        Display.makeCurrent();
    } catch (Exception e) {
        Log.error(e);
        throw new SlickException("Failed to create PBuffer for dynamic image. OpenGL driver failure?");
    }
}
项目:GPVM    文件:PBufferGraphics.java   
/**
 * Initialise the PBuffer that will be used to render to
 * 
 * @throws SlickException
 */
private void init() throws SlickException {
    try {
        Texture tex = InternalTextureLoader.get().createTexture(image.getWidth(), image.getHeight(), image.getFilter());

        final RenderTexture rt = new RenderTexture(false, true, false, false, RenderTexture.RENDER_TEXTURE_2D, 0);
        pbuffer = new Pbuffer(screenWidth, screenHeight, new PixelFormat(8, 0, 0), rt, null);

        // Initialise state of the pbuffer context.
        pbuffer.makeCurrent();

        initGL();
        GL.glBindTexture(GL11.GL_TEXTURE_2D, tex.getTextureID());
        pbuffer.releaseTexImage(Pbuffer.FRONT_LEFT_BUFFER);
        image.draw(0,0);
        image.setTexture(tex);

        Display.makeCurrent();
    } catch (Exception e) {
        Log.error(e);
        throw new SlickException("Failed to create PBuffer for dynamic image. OpenGL driver failure?");
    }
}
项目:GPVM    文件:PBufferGraphics.java   
/**
 * Initialise the PBuffer that will be used to render to
 * 
 * @throws SlickException
 */
private void init() throws SlickException {
    try {
        Texture tex = InternalTextureLoader.get().createTexture(image.getWidth(), image.getHeight(), image.getFilter());

        final RenderTexture rt = new RenderTexture(false, true, false, false, RenderTexture.RENDER_TEXTURE_2D, 0);
        pbuffer = new Pbuffer(screenWidth, screenHeight, new PixelFormat(8, 0, 0), rt, null);

        // Initialise state of the pbuffer context.
        pbuffer.makeCurrent();

        initGL();
        GL.glBindTexture(GL11.GL_TEXTURE_2D, tex.getTextureID());
        pbuffer.releaseTexImage(Pbuffer.FRONT_LEFT_BUFFER);
        image.draw(0,0);
        image.setTexture(tex);

        Display.makeCurrent();
    } catch (Exception e) {
        Log.error(e);
        throw new SlickException("Failed to create PBuffer for dynamic image. OpenGL driver failure?");
    }
}
项目:SpaceStationAlpha    文件:PBufferGraphics.java   
/**
 * Initialise the PBuffer that will be used to render to
 * 
 * @throws SlickException
 */
private void init() throws SlickException {
    try {
        Texture tex = InternalTextureLoader.get().createTexture(image.getWidth(), image.getHeight(), image.getFilter());

        final RenderTexture rt = new RenderTexture(false, true, false, false, RenderTexture.RENDER_TEXTURE_2D, 0);
        pbuffer = new Pbuffer(screenWidth, screenHeight, new PixelFormat(8, 0, 0), rt, null);

        // Initialise state of the pbuffer context.
        pbuffer.makeCurrent();

        initGL();
        GL.glBindTexture(GL11.GL_TEXTURE_2D, tex.getTextureID());
        pbuffer.releaseTexImage(Pbuffer.FRONT_LEFT_BUFFER);
        image.draw(0,0);
        image.setTexture(tex);

        Display.makeCurrent();
    } catch (Exception e) {
        Log.error(e);
        throw new SlickException("Failed to create PBuffer for dynamic image. OpenGL driver failure?");
    }
}
项目:cretion    文件:PBufferGraphics.java   
/**
 * Initialise the PBuffer that will be used to render to
 * 
 * @throws SlickException
 */
private void init() throws SlickException {
    try {
        Texture tex = InternalTextureLoader.get().createTexture(image.getWidth(), image.getHeight(), image.getFilter());

        final RenderTexture rt = new RenderTexture(false, true, false, false, RenderTexture.RENDER_TEXTURE_2D, 0);
        pbuffer = new Pbuffer(screenWidth, screenHeight, new PixelFormat(8, 0, 0), rt, null);

        // Initialise state of the pbuffer context.
        pbuffer.makeCurrent();

        initGL();
        GL.glBindTexture(GL11.GL_TEXTURE_2D, tex.getTextureID());
        pbuffer.releaseTexImage(Pbuffer.FRONT_LEFT_BUFFER);
        image.draw(0,0);
        image.setTexture(tex);

        Display.makeCurrent();
    } catch (Exception e) {
        Log.error(e);
        throw new SlickException("Failed to create PBuffer for dynamic image. OpenGL driver failure?");
    }
}
项目:slick2d-maven    文件:PBufferGraphics.java   
/**
 * Initialise the PBuffer that will be used to render to
 * 
 * @throws SlickException
 */
private void init() throws SlickException {
    try {
        Texture tex = InternalTextureLoader.get().createTexture(image.getWidth(), image.getHeight(), image.getFilter());

        final RenderTexture rt = new RenderTexture(false, true, false, false, RenderTexture.RENDER_TEXTURE_2D, 0);
        pbuffer = new Pbuffer(screenWidth, screenHeight, new PixelFormat(8, 0, 0), rt, null);

        // Initialise state of the pbuffer context.
        pbuffer.makeCurrent();

        initGL();
        GL.glBindTexture(GL11.GL_TEXTURE_2D, tex.getTextureID());
        pbuffer.releaseTexImage(Pbuffer.FRONT_LEFT_BUFFER);
        image.draw(0,0);
        image.setTexture(tex);

        Display.makeCurrent();
    } catch (Exception e) {
        Log.error(e);
        throw new SlickException("Failed to create PBuffer for dynamic image. OpenGL driver failure?");
    }
}