Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/jsf/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 处理帧缓冲区错误_Java_Opengl_Processing_Framebuffer - Fatal编程技术网

Java 处理帧缓冲区错误

Java 处理帧缓冲区错误,java,opengl,processing,framebuffer,Java,Opengl,Processing,Framebuffer,我试图制作一个处理程序,但如果我使用P2D、P3D或OPENGL模式,我会得到一个错误: com.sun.jdi.VMDisconnectedException at com.sun.tools.jdi.TargetVM.waitForReply(TargetVM.java:285) at com.sun.tools.jdi.VirtualMachineImpl.waitForTargetReply(VirtualMachineImpl.java:1015) at com

我试图制作一个处理程序,但如果我使用P2D、P3D或OPENGL模式,我会得到一个错误:

com.sun.jdi.VMDisconnectedException
    at com.sun.tools.jdi.TargetVM.waitForReply(TargetVM.java:285)
    at com.sun.tools.jdi.VirtualMachineImpl.waitForTargetReply(VirtualMachineImpl.java:1015)
    at com.sun.tools.jdi.PacketStream.waitForReply(PacketStream.java:51)
    at com.sun.tools.jdi.JDWP$ObjectReference$InvokeMethod.waitForReply(JDWP.java:4589)
    at com.sun.tools.jdi.ObjectReferenceImpl.invokeMethod(ObjectReferenceImpl.java:374)
    at processing.mode.java.runner.Runner.findException(Runner.java:701)
    at processing.mode.java.runner.Runner.reportException(Runner.java:652)
    at processing.mode.java.runner.Runner.exception(Runner.java:595)
    at processing.mode.java.runner.EventThread.exceptionEvent(EventThread.java:367)
    at processing.mode.java.runner.EventThread.handleEvent(EventThread.java:255)
    at processing.mode.java.runner.EventThread.run(EventThread.java:89)
错误消息本身在P2D和P3D之间有所不同,但它们都会出现无帧缓冲区对象可用错误。我正在使用processing 2.0b7,如果您需要更多信息,请帮助并让我知道。 注意:我不知道这是否是一个单独的问题,但我也得到了GLSL着色器错误。 现在,这是我的代码:

Cell[][] Cells = new Cell[50][50];
byte Direction = 1;
byte Times = 1;
int oldwidth = 500;
int oldheight = 500;
void setup() {
  size(oldwidth, oldheight, OPENGL);
  background(255);
  colorMode(HSB,250);
  for (int x = 0; x < 50; x++) {
    for (int y = 0; y < 50; y++) {
      Cells[x][y] = new Cell(x * 5, y * 5, 255, x * (width / 50), y * (height / 50), width / 50, height / 50);
    }
  }
}
void draw() {
  for (int x = 0; x < 50; x++) {
    for (int y = 0; y < 50; y++) {
      if (width == oldwidth) Cells[x][y].Width = width / 50;
      if (height == oldheight) Cells[x][y].Height = height / 50;
      if (Direction == 1){
        Cells[x][y].Hue += 5;
        if (Cells[x][y].Hue > 250) Cells[x][y].Hue -= 250;
      }
      if (Direction == 2){
        Cells[x][y].Saturation -= 5;
        if (Cells[x][y].Saturation < 0) Cells[x][y].Saturation += 500;
      }
      if (Direction == 3){
        Cells[x][y].Hue -= 5;
        if (Cells[x][y].Hue < 0) Cells[x][y].Hue += 250;
      }
      if (Direction == 4){
        Cells[x][y].Saturation += 5;
        if (Cells[x][y].Saturation > 500) Cells[x][y].Saturation -= 500;
      }
      Cells[x][y].Draw();
    }
  }
  if (Times == 50){
    Times = 1;
    if (Direction == 4) Direction = 1; else Direction += 1;
  } else Times += 1;
  delay(10);
}
class Cell {
  int X;
  int Y;
  int Width;
  int Height;
  float Hue;
  float Saturation;
  float Brightness;
  Cell(color parC, int parX, int parY, int parWidth, int parHeight) {
    Hue = hue(parC);
    Saturation = saturation(parC);
    Brightness = brightness(parC);
    X = parX;
    Y = parY;
    Width = parWidth;
    Height = parHeight;
  }
  Cell(float parHue, float parSaturation, float parBrightness, int parX, int parY, int parWidth, int parHeight) {
    Hue = parHue;
    Saturation = parSaturation;
    Brightness = parBrightness;
    X = parX;
    Y = parY;
    Width = parWidth;
    Height = parHeight;
  }
  void Draw() {
    if (Saturation > 250) if (Saturation > 500) stroke(color(Hue,0,Brightness)); else stroke(color(Hue,Saturation - (Saturation - 250) * 2,Brightness)); else stroke(color(Hue,Saturation,Brightness));
    if (Saturation > 250) if (Saturation > 500) fill(color(Hue,0,Brightness)); else fill(color(Hue,Saturation - (Saturation - 250) * 2,Brightness)); else fill(color(Hue,Saturation,Brightness));
    rect(X, Y, Width, Height);
  }
}
Cell[][]单元格=新单元格[50][50];
字节方向=1;
字节次数=1;
int oldwidth=500;
int oldheight=500;
无效设置(){
大小(oldwidth、oldheight、OPENGL);
背景(255);
彩色模式(HSB,250);
对于(int x=0;x<50;x++){
对于(int y=0;y<50;y++){
单元[x][y]=新单元(x*5,y*5,255,x*(宽度/50),y*(高度/50),宽度/50,高度/50);
}
}
}
作废提款(){
对于(int x=0;x<50;x++){
对于(int y=0;y<50;y++){
如果(宽度==oldwidth)单元格[x][y]。宽度=宽度/50;
如果(高度==旧高度)单元格[x][y]。高度=高度/50;
如果(方向==1){
细胞[x][y]。色调+=5;
如果(单元格[x][y]。色调>250)单元格[x][y]。色调-=250;
}
如果(方向==2){
细胞[x][y]。饱和度-=5;
如果(单元格[x][y]。饱和度<0)单元格[x][y]。饱和度+=500;
}
如果(方向==3){
细胞[x][y]。色调-=5;
如果(单元格[x][y]。色调<0)单元格[x][y]。色调+=250;
}
如果(方向==4){
电池[x][y]。饱和+=5;
如果(单元格[x][y]。饱和度>500)单元格[x][y]。饱和度-=500;
}
单元格[x][y]。绘制();
}
}
如果(次数==50){
次数=1;
如果(方向==4)方向=1;否则方向+=1;
}其他次数+=1;
延迟(10);
}
类单元{
int X;
int-Y;
整数宽度;
内部高度;
浮动色调;
浮动饱和;
浮动亮度;
单元格(颜色分区、整数分区、整数分区、整数分区宽度、整数分区高度){
色调=色调(parC);
饱和度=饱和度(parC);
亮度=亮度(parC);
X=parX;
Y=parY;
宽度=宽度;
高度=平均高度;
}
单元格(浮点像素色调、浮点像素饱和度、浮点像素亮度、整数像素、整数像素、整数像素宽度、整数像素高度){
色调=浅色调;
饱和=局部饱和;
亮度=平均亮度;
X=parX;
Y=parY;
宽度=宽度;
高度=平均高度;
}
作废提款(){
if(饱和度>250)if(饱和度>500)笔划(颜色(色调,0,亮度));else笔划(颜色(色调,饱和度-(饱和度-250)*2,亮度));else笔划(颜色(色调,饱和度,亮度));
if(饱和度>250)if(饱和度>500)填充(颜色(色调,0,亮度));else填充(颜色(色调,饱和度-(饱和度-250)*2,亮度));else填充(颜色(色调,饱和度,亮度));
矩形(X,Y,宽度,高度);
}
}

我刚刚意识到,只是我的图形卡不支持OPENGL 2.0

好的,我希望现在有人能给出答案。这一定是一个比我意识到的更难的问题!我通常会在询问时间后3-10分钟得到答案!奇怪的是,它在2.0b7 64x的三种模式中的任何一种模式下都非常适合我。顺便说一句,非常酷和古怪!谢谢,我想是的,它运行得不是很好,但是它可以在没有OPENGL模式的情况下运行。