check if hint is enabled/disabled

I am working on a class which must be evoked before DISABLE_DEPTH_TEST. this a little inconvenient at some moments when organising the code so I would like to be able to test if it is already disabled.

I thought this could work: boolean test = ((PGraphics3D)g).hints[ENABLE_DEPTH_TEST] ;

but hints is not visible in PGraphics: protected boolean[] hints = new boolean[HINT_COUNT];

Because this is being casted to ((PGraphics3D)g) I am a little confused on using reflection. Or I am doing something wrong?



  • Answer ✓

    Simplest approach is to store that information on your own.
    Create your own boolean for it. And change its true & false states along w/ hint(). *-:)

  • Thanks dude! I was "just wondering" if I could sneak peek this protected variables in a way but I was afraid it would add tons of extra lines to my silly code ;)

Sign In or Register to comment.