當前位置: 首頁>>代碼示例>>Java>>正文


Java GLRegion類代碼示例

本文整理匯總了Java中com.jogamp.graph.curve.opengl.GLRegion的典型用法代碼示例。如果您正苦於以下問題:Java GLRegion類的具體用法?Java GLRegion怎麽用?Java GLRegion使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


GLRegion類屬於com.jogamp.graph.curve.opengl包,在下文中一共展示了GLRegion類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: GPUTextRendererListenerBase01

import com.jogamp.graph.curve.opengl.GLRegion; //導入依賴的package包/類
public GPUTextRendererListenerBase01(final RenderState rs, final int renderModes, final int sampleCount, final boolean blending, final boolean debug, final boolean trace) {
    // NOTE_ALPHA_BLENDING: We use alpha-blending
    super(RegionRenderer.create(rs, blending ? RegionRenderer.defaultBlendEnable : null,
                                blending ? RegionRenderer.defaultBlendDisable : null),
                                renderModes, debug, trace);
    rs.setHintMask(RenderState.BITHINT_GLOBAL_DEPTH_TEST_ENABLED);
    this.textRegionUtil = new TextRegionUtil(renderModes);
    this.regionFPS = GLRegion.create(renderModes, null);
    this.regionBottom = GLRegion.create(renderModes, null);
    try {
        this.font = FontFactory.get(fontSet).getDefault();
        dumpFontNames();

        this.fontName = font.toString();
    } catch (final IOException ioe) {
        System.err.println("Caught: "+ioe.getMessage());
        ioe.printStackTrace();
    }
    setMatrix(0, 0, 0, 0f, sampleCount);
}
 
開發者ID:java-opengl-labs,項目名稱:jogl-samples,代碼行數:21,代碼來源:GPUTextRendererListenerBase01.java

示例2: createTestOutline

import com.jogamp.graph.curve.opengl.GLRegion; //導入依賴的package包/類
private void createTestOutline(){
    float offset = 0;
    outlineShape = new OutlineShape(getRenderer().getRenderState().getVertexFactory());
    outlineShape.addVertex(0.0f,-10.0f, true);
    outlineShape.addVertex(15.0f,-10.0f, true);
    outlineShape.addVertex(10.0f,5.0f, false);
    outlineShape.addVertex(15.0f,10.0f, true);
    outlineShape.addVertex(6.0f,15.0f, false);
    outlineShape.addVertex(5.0f,8.0f, false);
    outlineShape.addVertex(0.0f,10.0f,true);
    outlineShape.closeLastOutline(true);
    outlineShape.addEmptyOutline();
    outlineShape.addVertex(5.0f,-5.0f,true);
    outlineShape.addVertex(10.0f,-5.0f, false);
    outlineShape.addVertex(10.0f,0.0f, true);
    outlineShape.addVertex(5.0f,0.0f, false);
    outlineShape.closeLastOutline(true);

    /** Same shape as above but without any off-curve vertices */
    offset = 30;
    outlineShape.addEmptyOutline();
    outlineShape.addVertex(offset+0.0f,-10.0f, true);
    outlineShape.addVertex(offset+17.0f,-10.0f, true);
    outlineShape.addVertex(offset+11.0f,5.0f, true);
    outlineShape.addVertex(offset+16.0f,10.0f, true);
    outlineShape.addVertex(offset+7.0f,15.0f, true);
    outlineShape.addVertex(offset+6.0f,8.0f, true);
    outlineShape.addVertex(offset+0.0f,10.0f, true);
    outlineShape.closeLastOutline(true);
    outlineShape.addEmptyOutline();
    outlineShape.addVertex(offset+5.0f,0.0f, true);
    outlineShape.addVertex(offset+5.0f,-5.0f, true);
    outlineShape.addVertex(offset+10.0f,-5.0f, true);
    outlineShape.addVertex(offset+10.0f,0.0f, true);
    outlineShape.closeLastOutline(true);

    region = GLRegion.create(getRenderModes(), null);
    region.addOutlineShape(outlineShape, null, region.hasColorChannel() ? getRenderer().getRenderState().getColorStatic(new float[4]) : null);
}
 
開發者ID:java-opengl-labs,項目名稱:jogl-samples,代碼行數:40,代碼來源:GPURegionGLListener01.java

示例3: createTestOutline

import com.jogamp.graph.curve.opengl.GLRegion; //導入依賴的package包/類
private void createTestOutline(){
    float offset = 0;
    OutlineShape shape = new OutlineShape(getRenderer().getRenderState().getVertexFactory());
    outlineShapes.add(shape);
    shape.addVertex(0.0f,-10.0f,true);
    shape.addVertex(15.0f,-10.0f, true);
    shape.addVertex(10.0f,5.0f, false);
    shape.addVertex(15.0f,10.0f, true);
    shape.addVertex(6.0f,15.0f, false);
    shape.addVertex(5.0f,8.0f, false);
    shape.addVertex(0.0f,10.0f,true);
    shape.closeLastOutline(true);
    shape.addEmptyOutline();
    shape.addVertex(5.0f,-5.0f,true);
    shape.addVertex(10.0f,-5.0f, false);
    shape.addVertex(10.0f,0.0f, true);
    shape.addVertex(5.0f,0.0f, false);
    shape.closeLastOutline(true);

    /** Same shape as above but without any off-curve vertices */
    shape = new OutlineShape(getRenderer().getRenderState().getVertexFactory());
    outlineShapes.add(shape);
    offset = 30;
    shape.addVertex(offset+0.0f,-10.0f, true);
    shape.addVertex(offset+17.0f,-10.0f, true);
    shape.addVertex(offset+11.0f,5.0f, true);
    shape.addVertex(offset+16.0f,10.0f, true);
    shape.addVertex(offset+7.0f,15.0f, true);
    shape.addVertex(offset+6.0f,8.0f, true);
    shape.addVertex(offset+0.0f,10.0f, true);
    shape.closeLastOutline(true);
    shape.addEmptyOutline();
    shape.addVertex(offset+5.0f,0.0f, true);
    shape.addVertex(offset+5.0f,-5.0f, true);
    shape.addVertex(offset+10.0f,-5.0f, true);
    shape.addVertex(offset+10.0f,0.0f, true);
    shape.closeLastOutline(true);

    region = GLRegion.create(getRenderModes(), null);
    region.addOutlineShapes(outlineShapes, null, null);
}
 
開發者ID:java-opengl-labs,項目名稱:jogl-samples,代碼行數:42,代碼來源:GPURegionGLListener02.java

示例4: getRegion

import com.jogamp.graph.curve.opengl.GLRegion; //導入依賴的package包/類
public GLRegion getRegion(final GL2ES2 gl, final RegionRenderer renderer) {
    validate(gl, renderer);
    return region;
}
 
開發者ID:java-opengl-labs,項目名稱:jogl-samples,代碼行數:5,代碼來源:UIShape.java

示例5: createGLRegion

import com.jogamp.graph.curve.opengl.GLRegion; //導入依賴的package包/類
protected GLRegion createGLRegion() {
    return GLRegion.create(renderModes, null);
}
 
開發者ID:java-opengl-labs,項目名稱:jogl-samples,代碼行數:4,代碼來源:UIShape.java

示例6: createGLRegion

import com.jogamp.graph.curve.opengl.GLRegion; //導入依賴的package包/類
@Override
protected GLRegion createGLRegion() {
    return GLRegion.create(getRenderModes(), texSeq);
}
 
開發者ID:java-opengl-labs,項目名稱:jogl-samples,代碼行數:5,代碼來源:TextureSeqButton.java

示例7: renderString

import com.jogamp.graph.curve.opengl.GLRegion; //導入依賴的package包/類
public void renderString(final GLAutoDrawable drawable,
                         final Font font, final float pixelSize, final String text,
                         final int column, final float tx, final float ty, final float tz, final GLRegion region) {
    final int row = lastRow + 1;
    renderStringImpl(drawable, font, pixelSize, text, column, row, tx, ty, tz, false, region);
}
 
開發者ID:java-opengl-labs,項目名稱:jogl-samples,代碼行數:7,代碼來源:TextRendererGLELBase.java

示例8: renderStringImpl

import com.jogamp.graph.curve.opengl.GLRegion; //導入依賴的package包/類
private void renderStringImpl(final GLAutoDrawable drawable,
                              final Font font, final float pixelSize, final String text,
                              final int column, final int row,
                              final float tx, final float ty, final float tz, final boolean cacheRegion, final GLRegion region) {
    if( null != renderer ) {
        final GL2ES2 gl = drawable.getGL().getGL2ES2();

        float dx = tx;
        float dy;

        if( !exclusivePMVMatrix )  {
            dy = 1f-ty;
        } else {
            final int height = drawable.getSurfaceHeight();
            dy = height-ty;
        }
        final int newLineCount = TextRegionUtil.getCharCount(text, '\n');
        final float lineHeight = font.getLineHeight(pixelSize);
        dx += pixelScale * font.getAdvanceWidth('X', pixelSize) * column;
        dy -= pixelScale * lineHeight * ( row + 1 );

        final PMVMatrix pmvMatrix = rs.getMatrix();
        pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
        if( !exclusivePMVMatrix )  {
            pmvMatrix.glPushMatrix();
        } else {
            pmvMatrix.glLoadIdentity();
        }
        pmvMatrix.glTranslatef(dx, dy, tz);
        if( flipVerticalInGLOrientation && drawable.isGLOriented() ) {
            pmvMatrix.glScalef(pixelScale, -1f*pixelScale, 1f);
        } else if( 1f != pixelScale ) {
            pmvMatrix.glScalef(pixelScale, pixelScale, 1f);
        }
        renderer.enable(gl, true);
        if( cacheRegion ) {
            textRenderUtil.drawString3D(gl, renderer, font, pixelSize, text, null, vbaaSampleCount);
        } else if( null != region ) {
            TextRegionUtil.drawString3D(gl, region, renderer, font, pixelSize, text, null, vbaaSampleCount,
                                        textRenderUtil.tempT1, textRenderUtil.tempT2);
        } else {
            TextRegionUtil.drawString3D(gl, renderModes, renderer, font, pixelSize, text, null, vbaaSampleCount,
                                        textRenderUtil.tempT1, textRenderUtil.tempT2);
        }
        renderer.enable(gl, false);

        if( !exclusivePMVMatrix )  {
            pmvMatrix.glPopMatrix();
        }
        lastRow = row + newLineCount;
    }
}
 
開發者ID:java-opengl-labs,項目名稱:jogl-samples,代碼行數:53,代碼來源:TextRendererGLELBase.java


注:本文中的com.jogamp.graph.curve.opengl.GLRegion類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。