本文整理匯總了Java中processing.core.PGraphics.isGL方法的典型用法代碼示例。如果您正苦於以下問題:Java PGraphics.isGL方法的具體用法?Java PGraphics.isGL怎麽用?Java PGraphics.isGL使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類processing.core.PGraphics
的用法示例。
在下文中一共展示了PGraphics.isGL方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: beginScreen2D
import processing.core.PGraphics; //導入方法依賴的package包/類
static public void beginScreen2D(PGraphics pg){
pg.pushStyle();
pg.hint(PConstants.DISABLE_DEPTH_TEST);
pg.pushMatrix();
pg.resetMatrix();
if(pg.isGL() && pg.is3D()){
PGraphicsOpenGL pgl = (PGraphicsOpenGL)pg;
pushed_lights = pgl.lights;
pgl.lights = false;
pgl.pushProjection();
pgl.ortho(0, pg.width, -pg.height, 0, -Float.MAX_VALUE, +Float.MAX_VALUE);
}
}
示例2: endScreen2D
import processing.core.PGraphics; //導入方法依賴的package包/類
static public void endScreen2D(PGraphics pg){
if(pg.isGL() && pg.is3D()){
PGraphicsOpenGL pgl = (PGraphicsOpenGL)pg;
pgl.popProjection();
pgl.lights = pushed_lights;
}
pg.popMatrix();
pg.hint(PConstants.ENABLE_DEPTH_TEST);
pg.popStyle();
}
示例3: saveVideoFrame
import processing.core.PGraphics; //導入方法依賴的package包/類
public void saveVideoFrame(PGraphics pg){
if(!pg.isGL()) return;
// loadPixels();
PGraphicsOpenGL pgout = (PGraphicsOpenGL) pg;
gltex.resize(context, GL2.GL_RGB8, width, height, GL2.GL_RGB, GL2.GL_UNSIGNED_BYTE, GL2.GL_LINEAR, 3, 1);
if(copy == null){
copy = new Copy(context);
copy.shader.frag.setDefine("FLIP_Y", 1);
}
copy.apply(pgout, gltex);
bytebuffer = gltex.getByteTextureData(bytebuffer);
// int len = width*height*3;
int len = pg.pixelWidth * pg.pixelHeight * 3;
if(bytebuffer.length != len){
System.out.println(bytebuffer.length +" != "+ len);
}
// background(0);
// flush();
// blendMode(REPLACE);
// loadPixels();
// for(int y = 0; y < height; y++){
// for(int x = 0; x < width; x++){
//// int ir = ((height-1 - y) * width + x) * 3;
// int ir = (y * width + x) * 3;
// int iw = y * width + x;
//
// int r = bytebuffer[ir++] & 0xFF;
// int g = bytebuffer[ir++] & 0xFF;
// int b = bytebuffer[ir++] & 0xFF;
// pixels[iw] = 0xFF000000 | r << 16 | g << 8 | b;
//
// }
// }
// updatePixels();
video_export.saveFrame(bytebuffer);
// video_export.saveFrame();
}
示例4: apply
import processing.core.PGraphics; //導入方法依賴的package包/類
/**
* execute shader, using the given PGRaphics-rendertarget.
* @param tex_dst
*/
public void apply(PGraphics pg_dst){
if(pg_dst.isGL()){
apply((PGraphicsOpenGL)pg_dst);
}
}