当前位置: 首页>>代码示例>>Java>>正文


Java GLAutoDrawable类代码示例

本文整理汇总了Java中com.jogamp.opengl.GLAutoDrawable的典型用法代码示例。如果您正苦于以下问题:Java GLAutoDrawable类的具体用法?Java GLAutoDrawable怎么用?Java GLAutoDrawable使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


GLAutoDrawable类属于com.jogamp.opengl包,在下文中一共展示了GLAutoDrawable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: display

import com.jogamp.opengl.GLAutoDrawable; //导入依赖的package包/类
@Override
public void display(GLAutoDrawable drawable)
{
	inst.stepGame();

	GL2 gl = drawable.getGL().getGL2();

	gl.glLoadIdentity();
	gl.glClear(GL2.GL_COLOR_BUFFER_BIT | GL2.GL_DEPTH_BUFFER_BIT);
	
	if(inst.GAME_STARTED)
		setCamera(gl, glu);
	else
		setCameraMapping(gl, glu);
	
	drawMapGeometry(gl);
	drawEnts(gl);
	if(Shoot.DEBUG || !inst.GAME_STARTED)
		drawGraph(gl);
	
	gl.glTranslated((inst.getPlayerPos().x + inst.getOffset().x), (inst.getPlayerPos().y + inst.getOffset().y), 0);
	drawPlayerInfo(gl);
	
}
 
开发者ID:ben-j-c,项目名称:TopDownGame,代码行数:25,代码来源:Display.java

示例2: annotate

import com.jogamp.opengl.GLAutoDrawable; //导入依赖的package包/类
@Override
public void annotate(GLAutoDrawable drawable) {
       if(!isAnnotationEnabled() || !isFilterEnabled()) {
		return;
	}
       if(!isFilterEnabled()) {
		return;
	}
       GL2 gl=drawable.getGL().getGL2();

           gl.glPushMatrix();
           {
               for(int ctr=0;ctr<maxBoxNum;ctr++) {
               gl.glColor3f(0,0,ctr);
               gl.glLineWidth(2f);
               gl.glBegin(GL.GL_LINE_LOOP);
               gl.glVertex2i(startX[ctr],startY[ctr]);
               gl.glVertex2i(endX[ctr],startY[ctr]);
               gl.glVertex2i(endX[ctr],endY[ctr]);
               gl.glVertex2i(startX[ctr],endY[ctr]);
               gl.glEnd();
           }
           gl.glPopMatrix();
       }
   }
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:26,代码来源:MultipleXYTypeFilter.java

示例3: annotate

import com.jogamp.opengl.GLAutoDrawable; //导入依赖的package包/类
@Override
public void annotate(GLAutoDrawable drawable) {
    if (!isFilterEnabled()) {
        return;
    }
    GL2 gl = drawable.getGL().getGL2();
    gl.glPushMatrix();
    final GLUT glut = new GLUT();
    gl.glColor3f(1, 1, 1); // must set color before raster position (raster position is like glVertex)
    gl.glRasterPos3f(0, 0, 0);
    final float filteredOutPercent = 100 * (float) filteredOutEventCount / totalEventCount;
    String s = null;
    if (adaptiveFilteringEnabled) {
        s = String.format("dt=%.1fms, filteredOutPercent=%%%.1f, entropyReduction=%.1f",
                dt * 1e-3f, filteredOutPercent, entropyReduction);
    } else {
        s = String.format("filteredOutPercent=%%%.1f",
                filteredOutPercent);
    }
    glut.glutBitmapString(GLUT.BITMAP_HELVETICA_18, s);
    gl.glPopMatrix();
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:23,代码来源:SpatioTemporalCorrelationFilter.java

示例4: annotate

import com.jogamp.opengl.GLAutoDrawable; //导入依赖的package包/类
@Override
public void annotate(GLAutoDrawable drawable) {
	GL2 gl = drawable.getGL().getGL2();
	gl.glPushMatrix();
	String s = state.toString();
	gl.glScalef(.1f, .1f, 1);
	//        float l=glut.glutStrokeLengthf(GLUT.STROKE_ROMAN,s);
	gl.glTranslatef(0, chip.getSizeY() * .8f, 0);
	gl.glLineWidth(3);
	gl.glColor3f(1, 0, 0);
	glut.glutStrokeString(GLUT.STROKE_ROMAN, s);
	gl.glPopMatrix();
	switch (state) {
		case Replay:
			// draw replay progress bar
			gl.glPushMatrix();
			gl.glColor3f(0, 0, 1);
			gl.glRectf(1, 1, (chip.getSizeX() * (float) currentReplayPosition) / numEventsRecorded, 3);
			gl.glPopMatrix();
			break;
		case Live:
		case Init:
			//                info.annotate(drawable);
	}
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:26,代码来源:AutomaticReplayPlayer.java

示例5: annotate

import com.jogamp.opengl.GLAutoDrawable; //导入依赖的package包/类
@Override
public void annotate(final GLAutoDrawable drawable) {
	if (!showHotPixels) {
		return;
	}
	final GL2 gl = drawable.getGL().getGL2();
	try {
		gl.glEnable(GL.GL_BLEND);
		gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA);
		gl.glBlendEquation(GL.GL_FUNC_ADD);
	}
	catch (final GLException e) {
		e.printStackTrace();
		showHotPixels = false;
	}
	gl.glColor4f(.1f, .1f, 1f, .25f);
	gl.glLineWidth(1f);
	for (final HotPixel p : hotPixelSet) {
		gl.glRectf(p.x - 1, p.y - 1, p.x + 2, p.y + 2);
	}
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:22,代码来源:HotPixelFilter.java

示例6: display

import com.jogamp.opengl.GLAutoDrawable; //导入依赖的package包/类
/** Displays intensity along with normal 2d histograms.
 *
 * @param drawable
 */
@Override
public void display(GLAutoDrawable drawable) {
	super.display(drawable);
	if (intensityDisplayEnabled && (hasIntensity != null)) {
		GL2 gl = drawable.getGL().getGL2();
		gl.glLineWidth(10);
		gl.glColor3f(0, 1, 0);
		gl.glBegin(GL.GL_LINES);
		gl.glVertex2f(-1, 0);
		float f = hasIntensity.getIntensity()*intensityScale;
		f = f * getChipCanvas().getChip().getSizeY();
		gl.glVertex2f(-1, f);
		gl.glEnd();
		{
			renderer.begin3DRendering();
			renderer.setColor(1, 1, 1, 1f);
			renderer.draw3D("Intensity", -10, 3, 0, .2f); // TODO fix string n lines
			renderer.draw3D(String.format("%.2f", hasIntensity.getIntensity()), -10, 0, 0, .2f); // TODO fix string n lines
			renderer.end3DRendering();
		}

	}
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:28,代码来源:DVSWithIntensityDisplayMethod.java

示例7: annotate

import com.jogamp.opengl.GLAutoDrawable; //导入依赖的package包/类
@Override
    public void annotate(GLAutoDrawable drawable) {
        super.annotate(drawable);
//        if (targetLabeler != null) {
//            targetLabeler.annotate(drawable);
//        }
        if (hideOutput) {
            return;
        }
        GL2 gl = drawable.getGL().getGL2();
        checkBlend(gl);
        int sy = chip.getSizeY();
        if ((apsDvsNet != null) && (apsDvsNet.getOutputLayer() != null) && (apsDvsNet.getOutputLayer().getActivations()!= null)) {
            drawDecisionOutput(gl, sy, Color.GREEN);
        }

        error.draw(gl);

    }
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:20,代码来源:FaceDetectorCNN.java

示例8: annotate

import com.jogamp.opengl.GLAutoDrawable; //导入依赖的package包/类
@Override
public void annotate(GLAutoDrawable drawable) {
    if (aviOutputStream == null ) {
        return;
    }
    GL2 gl = drawable.getGL().getGL2();
    BufferedImage bi = toImage(gl, drawable.getNativeSurface().getSurfaceWidth(), drawable.getNativeSurface().getSurfaceHeight());

    try {
        aviOutputStream.writeFrame(bi);
        if (isWriteTimecodeFile()) {
            writeTimecode(chip.getAeViewer().getAePlayer().getTime());
        }
        incrementFramecountAndMaybeCloseOutput();

    } catch (Exception e) {
        log.warning("While writing AVI frame, caught exception, closing file: " + e.toString());
        doCloseFile();
    }
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:21,代码来源:JaerAviWriter.java

示例9: displayStats

import com.jogamp.opengl.GLAutoDrawable; //导入依赖的package包/类
public void displayStats(GLAutoDrawable drawable) {
    if ((drawable == null) || (chip.getCanvas() == null)) {
        return;
    }
    canvas = chip.getCanvas();
    glCanvas = (GLCanvas) canvas.getCanvas();
    int sx = chip.getSizeX(), sy = chip.getSizeY();
    Rectangle chipRect = new Rectangle(sx, sy);
    GL2 gl = drawable.getGL().getGL2();
    if (selection != null && chipRect.intersects(selection)) {
        drawSelection(gl, selection, SELECT_COLOR);
    }
    stats.drawStats(drawable);
    stats.play();

}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:17,代码来源:CellStatsProber.java

示例10: displayStats

import com.jogamp.opengl.GLAutoDrawable; //导入依赖的package包/类
public void displayStats(GLAutoDrawable drawable) {
    if ((drawable == null) || (selection == null) || (chip.getCanvas() == null)) {
        return;
    }
    canvas = chip.getCanvas();
    glCanvas = (GLCanvas) canvas.getCanvas();
    int sx = chip.getSizeX(), sy = chip.getSizeY();
    Rectangle chipRect = new Rectangle(sx, sy);
    GL2 gl = drawable.getGL().getGL2();
    if (!chipRect.intersects(selection)) {
        return;
    }
    drawSelection(gl, selection, SELECT_COLOR);
    stats.drawStats(drawable);
    stats.play();

}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:18,代码来源:CellStatsProber_cochlea.java

示例11: annotate

import com.jogamp.opengl.GLAutoDrawable; //导入依赖的package包/类
@Override
public void annotate(GLAutoDrawable drawable) {         //shows the class in the jAER window
    if ((drawable == null) || (chip.getCanvas() == null) || !classifyEvents || model == null) {
        return;
    }
    titleRenderer = new TextRenderer(new Font("Helvetica", Font.PLAIN, 40));
    Rectangle2D bounds = titleRenderer.getBounds("Unkown");
    titleArea = new Rectangle((int) bounds.getWidth(), (int) bounds.getHeight());
    GL2 gl = drawable.getGL().getGL2();
    gl.glColor3f(1, 1, 1);
    gl.glRasterPos3f(10, 10, 0);
    titleRenderer.beginRendering(drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
    titleRenderer.setColor(Color.WHITE);
    titleRenderer.draw(String.format("Class: %d", labeledClass), titleArea.x, titleArea.y);
    titleRenderer.endRendering();
    gl.glPushMatrix();
    gl.glLoadIdentity();
    gl.glTranslatef(drawable.getSurfaceWidth() / 2, drawable.getSurfaceHeight() / 2, 0);
    gl.glColor3f(1, 1, 1);
    float w = drawable.getSurfaceWidth() * lastdot * 5;
    gl.glRectf(0, -10, w, 10);
    gl.glPopMatrix();
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:24,代码来源:CochleaSVMTwoEars.java

示例12: annotate

import com.jogamp.opengl.GLAutoDrawable; //导入依赖的package包/类
@Override
public void annotate(GLAutoDrawable drawable) {
    if (!isFilterEnabled()) {
        return;
    }
    GL2 gl = drawable.getGL().getGL2();
    gl.glPushMatrix();
    final GLUT glut = new GLUT();
    gl.glColor3f(1, 1, 1);
    gl.glRasterPos3f(0, 0, 0);
    if (showAnnotations == true) {
        glut.glutBitmapString(GLUT.BITMAP_HELVETICA_18, String.format("avgITD(us)=%s", fmt.format(bestITD)));
        glut.glutBitmapString(GLUT.BITMAP_HELVETICA_18, String.format("  ITDConfidence=%f", avgITDConfidence));
        glut.glutBitmapString(GLUT.BITMAP_HELVETICA_18, String.format("  ILD=%f", ILD));
        if ((useLaterSpikeForWeight == true) || (usePriorSpikeForWeight == true)) {
            glut.glutBitmapString(GLUT.BITMAP_HELVETICA_18, String.format("  lastWeight=%f", lastWeight));
        }
    }
    if ((display == true) && (frame != null)) {
        //frame.setITD(avgITD);
        frame.setText(String.format("avgITD(us)=%s   ITDConfidence=%f   ILD=%f", fmt.format(bestITD), avgITDConfidence, ILD));
    }
    gl.glPopMatrix();
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:25,代码来源:ITDFilter_robothead6DOF.java

示例13: annotate

import com.jogamp.opengl.GLAutoDrawable; //导入依赖的package包/类
/** JOGL annotation */
public void annotate(GLAutoDrawable drawable) {
    if(!isFilterEnabled()) return;
    Point2D p=medianPoint;
    Point2D s=stdPoint;
    GL2 gl=drawable.getGL().getGL2();
    // already in chip pixel context with LL corner =0,0
    
    /*          //I took this out so it would not slow the program down
    gl.glPushMatrix();
    gl.glColor3f(0,0,1);
    gl.glLineWidth(4);
    gl.glBegin(GL2.GL_LINE_LOOP);
    gl.glVertex2d(p.getX()-s.getX(), p.getY()-s.getY());
    gl.glVertex2d(p.getX()+s.getX(), p.getY()-s.getY());
    gl.glVertex2d(p.getX()+s.getX(), p.getY()+s.getY());
    gl.glVertex2d(p.getX()-s.getX(), p.getY()+s.getY());
    gl.glEnd();
    gl.glPopMatrix();
    */

}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:23,代码来源:MedianTrackingFilter.java

示例14: annotate

import com.jogamp.opengl.GLAutoDrawable; //导入依赖的package包/类
@Override
public void annotate(GLAutoDrawable drawable)
{
	if(!isFilterEnabled()) {
		return;
	}
	GL2 gl=drawable.getGL().getGL2();
	gl.glPushMatrix();
	final GLUT glut=new GLUT();
	gl.glColor3f(1,1,1);
	gl.glRasterPos3f(0,0,0);
	glut.glutBitmapString(GLUT.BITMAP_HELVETICA_18, String.format("Total = %s", fmt.format(rate)));
	glut.glutBitmapString(GLUT.BITMAP_HELVETICA_18, String.format("; Coch0 = %s", fmt.format(coch0Rate)));
	glut.glutBitmapString(GLUT.BITMAP_HELVETICA_18, String.format("; Coch1 = %s", fmt.format(coch1Rate)));
	gl.glPopMatrix();
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:17,代码来源:CochleaEventRate.java

示例15: annotate

import com.jogamp.opengl.GLAutoDrawable; //导入依赖的package包/类
@Override
public synchronized void annotate(GLAutoDrawable drawable) {
    //        super.annotate(drawable);
    GL2 gl = drawable.getGL().getGL2();
    int offset = 0;
    final int w = 2;
    for (Cluster c : clusters) {
        CarCluster cc = (CarCluster) c;
        if (isShowAllClusters() || cc.isVisible()) {
            cc.draw(drawable);
            gl.glColor3f(0, 0, 1);
            gl.glRectf(offset, 0, offset + w, (chip.getSizeY() * cc.getSegmentSpeedSPS()) / 300);
            offset += 2 * w;
        }
    }
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:17,代码来源:CarTracker.java


注:本文中的com.jogamp.opengl.GLAutoDrawable类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。