当前位置: 首页>>代码示例>>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;未经允许,请勿转载。