Skip to content

Commit

Permalink
Add a debug toggle for tesselation of wide lines
Browse files Browse the repository at this point in the history
  • Loading branch information
10110111 committed Apr 22, 2023
1 parent 027ce50 commit 3f35207
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/StelPainter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@

static const int TEX_CACHE_LIMIT = 7000000;

bool tessellateWideLines = false; // XXX: for debugging

#ifndef NDEBUG
QMutex* StelPainter::globalMutex = new QMutex();
#endif
Expand Down Expand Up @@ -2542,7 +2544,7 @@ void StelPainter::drawFromArray(DrawingMode mode, int count, int offset, bool do
const QMatrix4x4 qMat(m[0], m[4], m[8], m[12], m[1], m[5], m[9], m[13], m[2], m[6], m[10], m[14], m[3], m[7], m[11], m[15]);

const bool wideLineMode = (mode==LineStrip || mode==LineLoop || mode==Lines) && StelMainView::getInstance().getGLInformation().isCoreProfile;
if(wideLineMode && projectedVertexArray.type == GL_FLOAT)
if(wideLineMode && projectedVertexArray.type == GL_FLOAT && tessellateWideLines)
{
const bool fixedColor = !texCoordArray.enabled && !colorArray.enabled && !normalArray.enabled;
if(fixedColor && !indices)
Expand Down
7 changes: 7 additions & 0 deletions src/core/modules/GridLinesMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
#include <QDebug>
#include <QFontMetrics>

extern bool tessellateWideLines; // XXX: for debugging

//! @class SkyGrid
//! Class which manages a grid to display in the sky.
class SkyGrid
Expand Down Expand Up @@ -2331,6 +2333,11 @@ void GridLinesMgr::setFlagAllPoints(const bool displayed)
//! Set flag for displaying Azimuthal Grid
void GridLinesMgr::setFlagAzimuthalGrid(const bool displayed)
{
if(displayed)
{
tessellateWideLines = !tessellateWideLines; // XXX: for debugging
qDebug() << "Wide line tessellation" << (tessellateWideLines ? "enabled" : "disabled");
}
if(displayed != aziGrid->isDisplayed())
{
aziGrid->setDisplayed(displayed);
Expand Down

0 comments on commit 3f35207

Please sign in to comment.