本文整理汇总了Java中processing.opengl.FrameBuffer类的典型用法代码示例。如果您正苦于以下问题:Java FrameBuffer类的具体用法?Java FrameBuffer怎么用?Java FrameBuffer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FrameBuffer类属于processing.opengl包,在下文中一共展示了FrameBuffer类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: beginDraw
import processing.opengl.FrameBuffer; //导入依赖的package包/类
public void beginDraw(PGraphicsOpenGL dst, boolean multisample){
// in case dst is the primary papplet graphics buffer, dont mess with the fbo
if(dst == dst.parent.g){
// defaultRenderSettings(0, 0, dst.width, dst.height); // TODO, need this?
return;
}
// 1) first try, multisample could be true, else try without multisample
FrameBuffer fbo = dst.getFrameBuffer(multisample);
if(fbo == null){
fbo = dst.getFrameBuffer(false);
}
// 2) try again, but explicitly load the texture now
if(fbo == null){
end();
dst.loadTexture();
begin();
fbo = dst.getFrameBuffer(multisample);
if(fbo == null){
fbo = dst.getFrameBuffer(false);
}
}
if(fbo == null){
System.out.println("DwPixelFlow.beginDraw(PGraphicsOpenGL) ERROR: Texture not initialized");
return;
}
multisample = (fbo == dst.getFrameBuffer(true));
fbo.bind();
defaultRenderSettings(0, 0, fbo.width, fbo.height);
if(multisample){
gl.glEnable(GL.GL_MULTISAMPLE);
}
pgl_dst = dst;
ACTIVE_FRAMEBUFFER = true;
}
示例2: updateFBO
import processing.opengl.FrameBuffer; //导入依赖的package包/类
private void updateFBO(PGraphicsOpenGL pg){
FrameBuffer mfb = pg.getFrameBuffer(true);
FrameBuffer ofb = pg.getFrameBuffer(false);
if (ofb != null && mfb != null) {
mfb.copyColor(ofb);
}
// errorCheck("DwPixelFlow.updateFBO(PGraphicsOpenGL pg)");
}
示例3: getFrameBuffer
import processing.opengl.FrameBuffer; //导入依赖的package包/类
public FrameBuffer getFrameBuffer() {
return currentGraphics.getFrameBuffer();
}