且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

libgdx Shaperenderer line .. 如何绘制具有特定宽度的线

更新时间:2022-06-27 02:41:02

查询支持的宽度范围和大小之间的差异范围内支持的宽度,使用参数调用 glGetGL_ALIASED_LINE_WIDTH_RANGE、GL_SMOOTH_LINE_WIDTH_RANGE 和GL_SMOOTH_LINE_WIDTH_GRANULARITY.

To query the range of supported widths and the size difference between supported widths within the range, call glGet with arguments GL_ALIASED_LINE_WIDTH_RANGE, GL_SMOOTH_LINE_WIDTH_RANGE, and GL_SMOOTH_LINE_WIDTH_GRANULARITY.

参考

为了避免特定于设备的行为,我使用了四边形.从一个小纹理中绘制一个 1x1 的正方形,然后定位、缩放(取决于您要绘制的线条的宽度和高度)、颜色和旋转它.

To avoid device specific behavior, I use a quad instead. Draw a 1x1 square from a small texture and then position, scale (depending on the width and height of the line you wanted to draw), color, and rotate it.