Login  Register

Re: Text Rendering to JOGL2

Posted by tami on Dec 30, 2011; 10:08pm
URL: https://forum.jogamp.org/Text-Rendering-to-JOGL2-tp3617263p3621979.html

Sven,

I decided I just couldn't wait on this, so I am really trying to figure out these demos - all so I can just render text!!

Anyway, no matter which way I turn, I keep running into the same runtime NPE whenever I need to use gl as far as textrenderer is concerned:

....
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
*** 2.1 (compatibility profile, any, new) - 2.1 APPLE-1.6.36
*** GLDebugMessage false
Matrix: -10.0/10.0 x-70.0 @0.0
Reshape: null
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at com.jogamp.graph.curve.opengl.Renderer.setColorStatic(Renderer.java:205)
at org.yourorghere.GPUTextRendererListenerBase01.display(GPUTextRendererListenerBase01.java:153)
at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:174)
at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:162)
....

This is the section of code and it's failing on the setColorStatic:

    public void display(GLAutoDrawable drawable) {
        final int width = drawable.getWidth();
        final int height = drawable.getHeight();
        GL2ES2 gl = drawable.getGL().getGL2ES2();
        
        gl.glClearColor(1.0f, 1.0f, 1.0f, 1.0f); // Demo02 needs to have this set here as well .. hmm ?
        gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);

        final TextRenderer textRenderer = (TextRenderer) getRenderer();
        //textRenderer.reshapeOrtho(null, width, height, 0.1f, 7000.0f);
        textRenderer.setColorStatic(gl, 0.0f, 0.0f, 0.0f);
        final GLAnimatorControl animator = drawable.getAnimator();
        final boolean _drawFPS = drawFPS && null != animator && animator.getTotalFPSFrames()>10;
        
Could the libraries I'm using be wrong or something?

Ugh!  :-(




On Wed, Dec 28, 2011 at 5:23 PM, tami [via jogamp] <[hidden email]> wrote:
> Since these 'graph' demos are complicated, ie. use a lot of OO stuff
and since many people requested a more simple demo,
I will write smaller ones - probably when starting the review of our API.
I can't tell when I can do it, but probably before mid January,
depends on other work items.

Yay!  That would be great!!  How will we know when it's ready and where to find it?  Thanks so much!


If you reply to this email, your message will be added to the discussion below:
http://forum.jogamp.org/Text-Rendering-to-JOGL2-tp3617263p3617464.html
To unsubscribe from Text Rendering to JOGL2, click here.
NAML