how to tell if renderer is 3D?
in
Library and Tool Development
•
1 years ago
in my scenegraph library (
http://transmote.com/nest/), i need to be able to tell if the current renderer is 3D or 2D. i had a line:
- bRendererIs3D = !(p.g instanceof PGraphics2D || p.g instanceof PGraphicsJava2D);
but PGraphics2D no longer exists in 2.0. so, i changed it to:
- bRendererIs3D = !(p.g instanceof PGraphics || p.g instanceof PGraphicsJava2D);
which works fine...but i'm wondering if there's a smarter, more maintainable way, so i don't have to do this again when renderers are added/removed/renamed, when the using libs that provide other renderers (e.g. GLGraphics, tho yes i know it's integrated into v2.0), etc.
any idears?
1