Re: AWT TextRenderer vs com.jogamp.graph.curve.opengl.TextRegionUtil
Posted by
gouessej on
Aug 23, 2018; 8:22am
URL: https://forum.jogamp.org/AWT-TextRenderer-vs-com-jogamp-graph-curve-opengl-TextRegionUtil-tp4039133p4039137.html
TextRenderer doesn't exist in com.jogamp.graph.curve.opengl but RegionRenderer does.
There is no example using com.jogamp.graph in jogl-demos. You should rather look at those classes:
https://github.com/sgothel/jogl/tree/master/src/test/com/jogamp/opengl/test/junit/graph/demos"better" is a subjectivity hint. Each solution has its pros and its cons. The legacy text renderer relies on AWT which means it can't work in AWT-free environment (typically Android) and it doesn't support forward compatible OpenGL contexts which is a serious limitation where no backward compatible context is available whereas the more recent API for text and curve drawing is resolution independent and supports both backward compatible contexts (as long as it supports shaders) and forward compatible contexts.
Personally, I use neither of them because I have different needs and their respective limitations bother me. My needs might be different of yours. I need to make my game work on terribly old hardware (OpenGL 1.3) with no shader and preferably without AWT. com.jogamp.graph.curve.opengl.TextRegionUtil goes to the right direction on the long term as some things seem to be almost impossible to achieve without shader but I persist in trying to find a more convenient solution for me.
Which kind of text do you need to draw?
Note that the new API has some widgets too.