TextRendererGLEL(final RenderState rs, final int renderModes, final int sampleCount) {
      super(renderModes, new int[] {sampleCount});
      setRendererCallbacks(RegionRenderer.defaultBlendEnable, RegionRenderer.defaultBlendDisable);
      setRenderState(rs);

      regionFPS = GLRegion.create(renderModes, null);
      regionFPSAnim = GLRegion.create(renderModes, null);
      if (null != fontFileName) {
        Font _font = null;
        try {
          _font = FontFactory.get(getClass(), fontFileName, false);
        } catch (IOException e) {
          e.printStackTrace();
        }
        font = _font;
      } else {
        font = getFont(fontSet, fontFamily, fontStylebits);
      }

      staticRGBAColor[0] = 0.1f;
      staticRGBAColor[1] = 0.1f;
      staticRGBAColor[2] = 0.1f;
      staticRGBAColor[3] = 1.0f;

      this.screenshot = new GLReadBufferUtil(false, false);
      // fontSizeMin = Math.max(8, fontSizeFixed-5);
      fontSizeMin = fontSizeFixed;
      fontSizeMax = fontSizeFixed + 8;
      fontSizeAnim = fontSizeFixed;
      fontSizeDelta = 0.01f;
    }
 @Override
 public void dispose(GLAutoDrawable drawable) {
   final GL2ES2 gl = drawable.getGL().getGL2ES2();
   screenshot.dispose(gl);
   regionFPS.destroy(gl);
   regionFPSAnim.destroy(gl);
   super.dispose(drawable);
 }
Example #3
0
  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);
  }